13 #ifndef USMODULEACTIVATOR_H_
14 #define USMODULEACTIVATOR_H_
16 #ifndef US_MODULE_NAME
17 #error Missing US_MODULE_NAME preprocessor define
21 #include <usModuleUtils_p.h>
111 #define US_EXPORT_MODULE_ACTIVATOR(_activator_type) \
112 extern "C" US_ABI_EXPORT us::ModuleActivator* US_CONCAT(_us_module_activator_instance_, US_MODULE_NAME) () \
114 struct ScopedPointer \
116 ScopedPointer(us::ModuleActivator* activator = 0) : m_Activator(activator) {} \
117 ~ScopedPointer() { delete m_Activator; } \
118 us::ModuleActivator* m_Activator; \
121 static ScopedPointer activatorPtr; \
122 if (activatorPtr.m_Activator == 0) activatorPtr.m_Activator = new _activator_type; \
123 return activatorPtr.m_Activator; \
Customizes the starting and stopping of a CppMicroServices module.
virtual void Unload(ModuleContext *context)=0
Called when this module is unloaded. In general, this method should undo the work that the ModuleActi...
virtual void Load(ModuleContext *context)=0
Called when this module is loaded. This method can be used to register services or to allocate any re...
virtual ~ModuleActivator()
Virtual destructor.