Apache Celix
2.4.0
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.
|
#include <ProvidedService.h>
Public Member Functions | |
ProvidedService (celix_dm_component_t *_cmp, std::string svcName, std::shared_ptr< I > svc, bool _cppService) | |
ProvidedService< T, I > & | setVersion (std::string v) |
ProvidedService< T, I > & | setProperties (celix::dm::Properties) |
template<typename U > | |
ProvidedService< T, I > & | addProperty (const std::string &key, const U &value) |
ProvidedService< T, I > & | addProperty (const std::string &key, const char *value) |
ProvidedService< T, I > & | addProperty (const std::string &key, const std::string &value) |
ProvidedService< T, I > & | build () |
ProvidedService< T, I > & | buildAsync () |
template<typename U > | |
ProvidedService< T, I > & | addProperty (const std::string &key, const U &value) |
Public Member Functions inherited from celix::dm::BaseProvidedService | |
BaseProvidedService (celix_dm_component_t *_cmp, std::string svcName, std::shared_ptr< void > svc, bool _cppService) | |
BaseProvidedService (BaseProvidedService &&)=delete | |
BaseProvidedService & | operator= (BaseProvidedService &&)=delete |
BaseProvidedService (const BaseProvidedService &)=delete | |
BaseProvidedService & | operator= (const BaseProvidedService &)=delete |
const std::string & | getName () const |
const std::string & | getVersion () const |
bool | isCppService () const |
void * | getService () const |
const celix::dm::Properties & | getProperties () const |
void | runBuild () |
void | wait () const |
Additional Inherited Members | |
Protected Attributes inherited from celix::dm::BaseProvidedService | |
celix_dm_component_t * | cCmp |
std::string | svcName |
std::shared_ptr< void > | svc |
bool | cppService |
std::string | svcVersion {} |
celix::dm::Properties | properties {} |
bool | provideAddedToCmp {false} |
ProvidedService::ProvidedService | ( | celix_dm_component_t * | _cmp, |
std::string | svcName, | ||
std::shared_ptr< I > | svc, | ||
bool | _cppService | ||
) |
ProvidedService< T, I > & ProvidedService::addProperty | ( | const std::string & | key, |
const char * | value | ||
) |
Add/override a single property to the service properties.
ProvidedService< T, I > & ProvidedService::addProperty | ( | const std::string & | key, |
const std::string & | value | ||
) |
Add/override a single property to the service properties.
ProvidedService<T,I>& celix::dm::ProvidedService< T, I >::addProperty | ( | const std::string & | key, |
const U & | value | ||
) |
Add/override a single property to the service properties. U should support std::to_string.
ProvidedService<T, I>& celix::dm::ProvidedService< T, I >::addProperty | ( | const std::string & | key, |
const U & | value | ||
) |
ProvidedService< T, I > & ProvidedService::build | ( | ) |
Build the provided service A provided service added to an active component will only become active if the build is called.
When build and the component is active, the service will be registered when this call is done.
Should not be called on the Celix event thread.
ProvidedService< T, I > & ProvidedService::buildAsync | ( | ) |
Same a build, but will not wait till the underlining service is registered Can be called on the Celix event thread.
ProvidedService< T, I > & ProvidedService::setProperties | ( | celix::dm::Properties | p | ) |
Set the properties of the interface. Note this will reset the already set / added properties
ProvidedService< T, I > & celix::dm::ProvidedService< T, I >::setVersion | ( | std::string | v | ) |
Set the version of the interface