Apache Celix  latest
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
Public Member Functions | List of all members
celix::Framework Class Reference

A Celix framework instance. A framework is also known as a system bundle. More...

#include <Framework.h>

Public Member Functions

 Framework (std::shared_ptr< celix::BundleContext > _fwCtx, celix_framework_t *_cFw)
 
std::string getUUID () const
 Get the framework UUID. More...
 
std::shared_ptr< celix::BundleContextgetFrameworkBundleContext () const
 Get the bundle context for the framework. More...
 
long fireGenericEvent (long bndId, const char *eventName, std::function< void()> processEventCallback, long eventId=-1)
 Fire a generic Celix framework event. More...
 
void waitForStop ()
 Block until the framework is stopped. More...
 
void waitForEvent (long eventId)
 Wait until all Celix event for this framework are completed. More...
 
celix_framework_t * getCFramework () const
 Get the C framework. More...
 

Detailed Description

A Celix framework instance. A framework is also known as a system bundle.

Celix framework instances are created using a FrameworkFactory.

Note
Thread safe.

Constructor & Destructor Documentation

◆ Framework()

celix::Framework::Framework ( std::shared_ptr< celix::BundleContext _fwCtx,
celix_framework_t *  _cFw 
)
inline

Member Function Documentation

◆ fireGenericEvent()

long celix::Framework::fireGenericEvent ( long  bndId,
const char *  eventName,
std::function< void()>  processEventCallback,
long  eventId = -1 
)
inline

Fire a generic Celix framework event.

The event will be added to the event loop and handled on the event loop thread.

if bndId >=0 the bundle usage count will be increased while the event is not yet processed or finished processing. The name is expected to be const char* valid during til the event is finished processing.

if eventId >=0 this will be used, otherwise a new event id will be generated.

Returns
the event id (can be used in Framework::waitForEvent).

◆ getCFramework()

celix_framework_t* celix::Framework::getCFramework ( ) const
inline

Get the C framework.

Warning
Try not the depend on the C API from a C++ bundle. If features are missing these should be added to the C++ API.

◆ getFrameworkBundleContext()

std::shared_ptr<celix::BundleContext> celix::Framework::getFrameworkBundleContext ( ) const
inline

Get the bundle context for the framework.

◆ getUUID()

std::string celix::Framework::getUUID ( ) const
inline

Get the framework UUID.

◆ waitForEvent()

void celix::Framework::waitForEvent ( long  eventId)
inline

Wait until all Celix event for this framework are completed.

◆ waitForStop()

void celix::Framework::waitForStop ( )
inline

Block until the framework is stopped.


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