This category includes classes related to the C++ Micro Services component. More...
Namespaces | |
namespace | ServiceConstants |
Classes | |
class | Module |
Represents a CppMicroServices module. More... | |
struct | ModuleActivator |
Customizes the starting and stopping of a CppMicroServices module. More... | |
class | ModuleContext |
A module's execution context within the framework. More... | |
class | ModuleEvent |
An event from the Micro Services framework describing a module lifecycle change. More... | |
class | ModuleRegistry |
Here we handle all the modules that are loaded in the framework. More... | |
class | ModuleResource |
Represents a resource (text file, image, etc.) embedded in a CppMicroServices module. More... | |
class | ModuleResourceStream |
An input stream class for ModuleResource objects. More... | |
class | ModuleSettings |
Query and set certain properties of the CppMicroServices library. More... | |
class | ModuleVersion |
Version identifier for CppMicroServices modules. More... | |
class | LDAPFilter |
An RFC 1960-based Filter. More... | |
class | ServiceEvent |
An event from the Micro Services framework describing a service lifecycle change. More... | |
class | ServiceException |
A service exception used to indicate that a service problem occurred. More... | |
class | ServiceFactory |
Allows services to provide customized service objects in the module environment. More... | |
class | ServiceReference |
A reference to a service. More... | |
class | ServiceRegistration |
A registered service. More... | |
class | ServiceTracker< S, T > |
The ServiceTracker class simplifies using services from the framework's service registry. More... | |
struct | ServiceTrackerCustomizer< T > |
The ServiceTrackerCustomizer interface allows a ServiceTracker to customize the service objects that are tracked. More... | |
Macros | |
#define | US_EXPORT_MODULE_ACTIVATOR(_module_libname, _activator_type) |
Export a module activator class. More... | |
#define | US_IMPORT_MODULE(_import_module_libname) |
Import a static module. More... | |
#define | US_IMPORT_MODULE_RESOURCES(_import_module_libname) |
Import a static module's resources. More... | |
#define | US_LOAD_IMPORTED_MODULES_INTO_MAIN(_static_modules) |
Import a list of static modules into an executable. More... | |
#define | US_LOAD_IMPORTED_MODULES(_module_libname, _static_modules) |
Import a list of static modules into a shared library. More... | |
#define | US_INITIALIZE_MODULE(_module_name, _module_libname) |
Creates initialization code for a module. More... | |
#define | US_INITIALIZE_EXECUTABLE(_executable_id) |
Creates initialization code for an executable. More... | |
#define | US_DECLARE_SERVICE_INTERFACE(_service_interface_type, _service_interface_id) |
Declare a CppMicroServices service interface. More... | |
Typedefs | |
typedef US_UNORDERED_MAP_TYPE < std::string, Any > | ServiceProperties |
A hash table with std::string as the key type and Any as the value type. More... | |
Functions | |
ModuleContext * | GetModuleContext () |
Returns the module context of the calling module. More... | |
std::ostream & | operator<< (std::ostream &os, const Module &module) |
std::ostream & | operator<< (std::ostream &os, Module const *module) |
std::ostream & | operator<< (std::ostream &os, const ModuleResource &resource) |
std::ostream & | operator<< (std::ostream &os, const ModuleVersion &v) |
std::ostream & | operator<< (std::ostream &os, const LDAPFilter &filter) |
template<class T > | |
const char * | us_service_interface_iid () |
Returns a unique id for a given type. More... | |
std::ostream & | operator<< (std::ostream &os, const ServiceReference &serviceRef) |
std::ostream & | operator<< (std::ostream &os, ModuleEvent::Type eventType) |
std::ostream & | operator<< (std::ostream &os, const ModuleEvent &event) |
std::ostream & | operator<< (std::ostream &os, const ServiceEvent::Type &type) |
std::ostream & | operator<< (std::ostream &os, const ServiceEvent &event) |
std::ostream & | operator<< (std::ostream &os, const ServiceException &exc) |
This category includes classes related to the C++ Micro Services component.
The C++ Micro Services component provides a dynamic service registry based on the service layer as specified in the OSGi R4.2 specifications.
#define US_DECLARE_SERVICE_INTERFACE | ( | _service_interface_type, | |
_service_interface_id | |||
) |
Declare a CppMicroServices service interface.
This macro associates the given identifier _service_interface_id (a string literal) to the interface class called _service_interface_type. The Identifier must be unique. For example:
This macro is normally used right after the class definition for _service_interface_type, in a header file.
If you want to use US_DECLARE_SERVICE_INTERFACE with interface classes declared in a namespace then you have to make sure the US_DECLARE_SERVICE_INTERFACE macro call is not inside a namespace though. For example:
_service_interface_type | The service interface type. |
_service_interface_id | A string literal representing a globally unique identifier. |
#define US_EXPORT_MODULE_ACTIVATOR | ( | _module_libname, | |
_activator_type | |||
) |
Export a module activator class.
_module_libname | The physical name of the module, without prefix or suffix. |
_activator_type | The fully-qualified type-name of the module activator class. |
Call this macro after the definition of your module activator to make it accessible by the CppMicroServices library.
Example:
_module_libname
argument must match the value of _module_name
used in the US_INITIALIZE_MODULE
macro call. #define US_IMPORT_MODULE | ( | _import_module_libname | ) |
Import a static module.
_import_module_libname | The physical name of the module to import, without prefix or suffix. |
This macro imports the static module named _import_module_libname
.
Inserting this macro into your application's source code will allow you to make use of a static module. Do not forget to list the imported module when calling the macro US_LOAD_IMPORTED_MODULES and to actually link the static module to the importing executable or shared library.
Example:
#define US_IMPORT_MODULE_RESOURCES | ( | _import_module_libname | ) |
Import a static module's resources.
_import_module_libname | The physical name of the module to import, without prefix or suffix. |
This macro imports the resources of the static module named _import_module_libname
.
Inserting this macro into your application's source code will allow you to make use of the resources embedded in a static module. Do not forget to list the imported module when calling the macro US_LOAD_IMPORTED_MODULES and to actually link the static module to the importing executable or shared library.
#define US_INITIALIZE_EXECUTABLE | ( | _executable_id | ) |
Creates initialization code for an executable.
Each executable which wants to register itself with the CppMicroServices library has to put a call to this macro in one of its source files. This ensures that the executable will get its own ModuleContext instance and can access the service registry.
Example call for an executable:
This will initialize the executable for use with the CppMicroServices library, using a default auto-load directory named after the provided executable id in _executable_id
.
usFunctionGenerateExecutableInit()
._executable_id | A valid C identifier for the executable (no spaces etc.). |
#define US_INITIALIZE_MODULE | ( | _module_name, | |
_module_libname | |||
) |
Creates initialization code for a module.
Each module which wants to register itself with the CppMicroServices library has to put a call to this macro in one of its source files.
Example call for a module with file-name "libmylibname.so":
This will initialize the module for use with the CppMicroServices library, using a default auto-load directory named after the provided library name in _module_libname
.
usFunctionGenerateModuleInit()
._module_name | A human-readable name for the module. If you use this macro in a source file for an executable, the module name must be a valid C-identifier (no spaces etc.). |
_module_libname | The physical name of the module, withou prefix or suffix. |
#define US_LOAD_IMPORTED_MODULES | ( | _module_libname, | |
_static_modules | |||
) |
Import a list of static modules into a shared library.
_module_libname | The physical name of the importing module, without prefix or suffix. |
_static_modules | A space-deliminated list of physical module names, without prefix or suffix. |
This macro ensures that the ModuleActivator::Load(ModuleContext*) function is called for each imported static module when the importing shared library is loaded (if the static module provides an activator). If the static module provides embedded resources and the US_IMPORT_MODULE_RESOURCES macro was called, the resources will be made available through the importing module.
There must be exactly one call of this macro in the shared library which is importing static modules.
Example:
#define US_LOAD_IMPORTED_MODULES_INTO_MAIN | ( | _static_modules | ) |
Import a list of static modules into an executable.
_static_modules | A space-deliminated list of physical module names, without prefix or suffix. |
This macro ensures that the ModuleActivator::Load(ModuleContext*) function is called for each imported static module when the importing executable is loaded (if the static module provides an activator). If the static module provides embedded resources and the US_IMPORT_MODULE_RESOURCES macro was called, the resources will be made available through the importing module.
There must be exactly one call of this macro in the executable which is importing static modules.
Example:
typedef US_UNORDERED_MAP_TYPE<std::string, Any> ServiceProperties |
A hash table with std::string as the key type and Any as the value type.
It is typically used for passing service properties to ModuleContext::RegisterService.
ModuleContext* GetModuleContext | ( | ) |
Returns the module context of the calling module.
This function allows easy access to the ModuleContext instance from inside a C++ Micro Services module.
std::ostream& operator<< | ( | std::ostream & | os, |
const ServiceException & | exc | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
ModuleEvent::Type | eventType | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const ModuleEvent & | event | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const LDAPFilter & | filter | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const ServiceEvent::Type & | type | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const ServiceEvent & | event | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const ServiceReference & | serviceRef | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const ModuleVersion & | v | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const ModuleResource & | resource | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const Module & | module | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
Module const * | module | ||
) |
|
inline |
Returns a unique id for a given type.
This template method is specialized in the macro US_DECLARE_SERVICE_INTERFACE to return a unique id for each service interface.
T | The service interface type. |