Go to the source code of this file.
◆ CELIX_GEN_CXX_BUNDLE_ACTIVATOR
#define CELIX_GEN_CXX_BUNDLE_ACTIVATOR |
( |
|
actType | ) |
|
Value:
return celix::impl::createActivator<actType>(context, userData); \
} \
\
\
return CELIX_SUCCESS; \
} \
\
return celix::impl::destroyActivator<actType>(userData); \
} \
\
\
return CELIX_SUCCESS; \
}
Macro to generate the required bundle activator functions for C++. This can be used to more type safe bundle activator entries.
The macro will create the following bundle activator C functions:
- bundleActivator_create, which will create the required C++ object (bundle context and dependency manager) and create the C++ bundle activator class (RAII)
- bundleActivator_start function, which for C++ will do nothing.
- bundleActivator_stop function, which will trigger the destruction of the C++ BundleActivator and ensure that there is no dangling usage of the bundle context and/or dependency manager.
- bundleActivator_destroy function, which for C++ will do nothing.
The destruction of the C++ BundleActivator is triggered in the bundleActivator_stop instead of bundleActivator_destroy to ensure that the C++ dependency manager does is cleanup before the C dependency manager. This is needed, because the C dependency manager is not aware of "above lying" C++ objects.
- Parameters
-
type | The activator type (e.g. 'ShellActivator'). A type which should have a constructor with a single argument of std::shared_ptr<celix::BundleContext> or std::shared_ptr<DependencyManager>. |
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_stop(void *userData, celix_bundle_context_t *ctx)
Called when this bundle is stopped so the Framework can perform the bundle-specific activities necess...
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_destroy(void *userData, celix_bundle_context_t *ctx)
Called when this bundle is stopped so the bundle can destroy the instance of its activator.
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_start(void *userData, celix_bundle_context_t *ctx)
Called when this bundle is started so the Framework can perform the bundle-specific activities necess...
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_create(celix_bundle_context_t *ctx, void **userData)
Called when this bundle is started so the bundle can create an instance for its activator.