Apache Celix
2.3.0
An implementation of the OSGi specification adapted to C and C++
|
Go to the documentation of this file.
39 Framework(std::shared_ptr<celix::BundleContext> _fwCtx, celix_framework_t* _cFw) :
40 fwCtx{std::move(_fwCtx)},
41 cFw{std::shared_ptr<celix_framework_t >{_cFw, [](celix_framework_t*){}}}
47 [[nodiscard]] std::string
getUUID()
const {
70 long fireGenericEvent(
long bndId,
const char* eventName, std::function<
void()> processEventCallback,
long eventId = -1) {
71 auto* callbackOnHeap =
new std::function<void()>{};
72 *callbackOnHeap = std::move(processEventCallback);
78 static_cast<void*
>(callbackOnHeap),
80 auto* callback = static_cast<std::function<void()>*>(data);
112 const std::shared_ptr<celix::BundleContext> fwCtx;
113 const std::shared_ptr<celix_framework_t> cFw;
void celix_framework_waitForGenericEvent(celix_framework_t *fw, long eventId)
Wait until a event with the provided event id is completely handled. This function will directly retu...
long celix_framework_fireGenericEvent(celix_framework_t *fw, long eventId, long bndId, const char *eventName, void *processData, void(*processCallback)(void *data), void *doneData, void(*doneCallback)(void *doneData))
Fire a generic event. The event will be added to the event loop and handled on the event loop thread.
void celix_framework_waitForStop(celix_framework_t *framework)
Wait until the framework is stopped.
long fireGenericEvent(long bndId, const char *eventName, std::function< void()> processEventCallback, long eventId=-1)
Fire a generic Celix framework event.
Definition: Framework.h:70
celix_framework_t * getCFramework() const
Get the C framework.
Definition: Framework.h:108
const char * celix_framework_getUUID(const celix_framework_t *fw)
Returns the framework UUID. This is unique for every created framework and will not be the same if th...
std::string getUUID() const
Get the framework UUID.
Definition: Framework.h:47
void waitForStop()
Block until the framework is stopped.
Definition: Framework.h:91
std::shared_ptr< celix::BundleContext > getFrameworkBundleContext() const
Get the bundle context for the framework.
Definition: Framework.h:54
void waitForEvent(long eventId)
Wait until all Celix event for this framework are completed.
Definition: Framework.h:98
A Celix framework instance. A framework is also known as a system bundle.
Definition: Framework.h:37
Framework(std::shared_ptr< celix::BundleContext > _fwCtx, celix_framework_t *_cFw)
Definition: Framework.h:39