AudioManager  7.6.6
Native Application Runtime Environment
am::CAmCommonAPIWrapper Class Reference

#include <CAmCommonAPIWrapper.h>

Public Member Functions

virtual ~CAmCommonAPIWrapper ()
 
CAmSocketHandlergetSocketHandler () const
 Getter for the socket handler. More...
 
template<class TStubImp >
bool registerService (const std::shared_ptr< TStubImp > &shStub, const std::string &domain, const std::string &instance)
 Register stub objects. More...
 
bool unregisterService (const std::string &domain, const std::string &interface, const std::string &instance)
 Unregister stub objects. More...
 
template<class TStubImp >
bool __attribute__ ((deprecated)) registerStub(const std
 Deprecated method. More...
 
bool __attribute__ ((deprecated)) unregisterStub(const std
 Deprecated method. More...
 
template<template< typename... > class ProxyClass, typename... AttributeExtensions>
std::shared_ptr< ProxyClass< AttributeExtensions... > > buildProxy (const std::string &domain, const std::string &instance)
 Build proxy objects. More...
 
template<template< typename... > class ProxyClass, typename... AttributeExtensions>
std::shared_ptr< ProxyClass< AttributeExtensions... > > __attribute__ ((deprecated)) buildProxy(const std
 Deprecated method. More...
 

Static Public Member Functions

static CAmCommonAPIWrappergetInstance ()
 Returns an already instantiated object. More...
 
static void deleteInstance ()
 Deletes the instanciated object. More...
 
static CAmCommonAPIWrapperinstantiateOnce (CAmSocketHandler *socketHandler, const std::string &applicationName="")
 Creates a singleton instance attached to the provided socket handler object. More...
 

Protected Member Functions

 CAmCommonAPIWrapper (CAmSocketHandler *socketHandler, const std::string &applicationName="")
 

Detailed Description

Definition at line 49 of file CAmCommonAPIWrapper.h.

Constructor & Destructor Documentation

am::CAmCommonAPIWrapper::CAmCommonAPIWrapper ( CAmSocketHandler socketHandler,
const std::string &  applicationName = "" 
)
protected

Definition at line 39 of file CAmCommonAPIWrapper.cpp.

am::CAmCommonAPIWrapper::~CAmCommonAPIWrapper ( )
virtual

Definition at line 73 of file CAmCommonAPIWrapper.cpp.

Member Function Documentation

template<class TStubImp >
bool am::CAmCommonAPIWrapper::__attribute__ ( (deprecated)  ) const
inline

Deprecated method.

Instead you should use bool registerService(const std::shared_ptr<TStubImp> & shStub, const std::string & domain, const std::string & instance).

Register stub objects.

Example: std::shared_ptr<ConcreteStubClass> aStub; registerService( aStub, "local:com.your_company.interface_name:com.your_company.instance_name");

Parameters
shStubShared pointer to a stub instance
addressComplete common-api address as example "local:com.your_company.interface_name:com.your_company.instance_name"

Definition at line 195 of file CAmCommonAPIWrapper.h.

bool am::CAmCommonAPIWrapper::__attribute__ ( (deprecated)  ) const
inline

Deprecated method.

Instead you should use bool unregisterService(const std::string &domain, const std::string &interface, const std::string &instance).

Unregister stub objects.

Parameters
addressComplete common-api address as example "local:com.your_company.interface_name:com.your_company.instance_name"

Definition at line 211 of file CAmCommonAPIWrapper.h.

template<template< typename... > class ProxyClass, typename... AttributeExtensions>
std::shared_ptr<ProxyClass<AttributeExtensions...> > am::CAmCommonAPIWrapper::__attribute__ ( (deprecated)  ) const
inline

Deprecated method.

Instead you should use buildProxy(const std::string &domain, const std::string &instance).

Build proxy objects. Example: std::shared_ptr<AProxyClass<>> aProxy = buildProxy<AProxyClass>("local:com.your_company.interface_name:com.your_company.instance_name");

Parameters
addressComplete common-api address as example "local:com.your_company.interface_name:com.your_company.instance_name"
Returns
A proxy object.

Definition at line 266 of file CAmCommonAPIWrapper.h.

template<template< typename... > class ProxyClass, typename... AttributeExtensions>
std::shared_ptr<ProxyClass<AttributeExtensions...> > am::CAmCommonAPIWrapper::buildProxy ( const std::string &  domain,
const std::string &  instance 
)
inline

Build proxy objects.

Example: std::shared_ptr<AProxyClass<>> aProxy = buildProxy<AProxyClass>("local", "com.your_company.instance_name");

Parameters
domainA string with the domain name, usually "local"
instanceCommon-api instance string as example "com.your_company.instance_name"
Returns
A proxy object.

Definition at line 249 of file CAmCommonAPIWrapper.h.

void am::CAmCommonAPIWrapper::deleteInstance ( )
static

Deletes the instanciated object.

Definition at line 97 of file CAmCommonAPIWrapper.cpp.

CAmCommonAPIWrapper * am::CAmCommonAPIWrapper::getInstance ( )
static

Returns an already instantiated object.

This method should be called after the instantiateOnce(...) has been called with non null socket handler parameter.

Returns
The common-api wrapper object.

Definition at line 112 of file CAmCommonAPIWrapper.cpp.

CAmSocketHandler* am::CAmCommonAPIWrapper::getSocketHandler ( ) const
inline

Getter for the socket handler.

Returns
Pointer to the socket handler.

Definition at line 135 of file CAmCommonAPIWrapper.h.

CAmCommonAPIWrapper * am::CAmCommonAPIWrapper::instantiateOnce ( CAmSocketHandler socketHandler,
const std::string &  applicationName = "" 
)
static

Creates a singleton instance attached to the provided socket handler object.

This method should be called only once because it instantiates a single object. Otherwise it will throw an exception. The first call of this method with non null parameter loads the common-api and attaches it to the main loop.

Parameters
socketHandlerA pointer to socket handler or NULL
Returns
The common-api wrapper object.

Definition at line 83 of file CAmCommonAPIWrapper.cpp.

template<class TStubImp >
bool am::CAmCommonAPIWrapper::registerService ( const std::shared_ptr< TStubImp > &  shStub,
const std::string &  domain,
const std::string &  instance 
)
inline

Register stub objects.

Example: std::shared_ptr<ConcreteStubClass> aStub; registerService( aStub, "local", "com.your_company.instance_name");

Parameters
shStubShared pointer to a stub instance
domainA string with the domain name, usually "local"
instanceCommon-api instance string as example "com.your_company.instance_name"

Definition at line 165 of file CAmCommonAPIWrapper.h.

bool am::CAmCommonAPIWrapper::unregisterService ( const std::string &  domain,
const std::string &  interface,
const std::string &  instance 
)
inline

Unregister stub objects.

Parameters
domainA string with the domain name, usually "local"
interfaceCommon-api interface string as example "com.your_company.interface_name"
instanceCommon-api instance string as example "com.your_company.instance_name"

Definition at line 178 of file CAmCommonAPIWrapper.h.


The documentation for this class was generated from the following files: