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.
|
A service dependency for a component. More...
#include <ServiceDependency.h>
Public Member Functions | |
CServiceDependency (celix_dm_component_t *cCmp, const std::string &name) | |
~CServiceDependency () override=default | |
CServiceDependency (const CServiceDependency &)=delete | |
CServiceDependency & | operator= (const CServiceDependency &)=delete |
CServiceDependency (CServiceDependency &&) noexcept=delete | |
CServiceDependency & | operator= (CServiceDependency &&) noexcept=delete |
CServiceDependency< T, I > & | setVersionRange (const std::string &serviceVersionRange) |
CServiceDependency< T, I > & | setFilter (const std::string &filter) |
CServiceDependency< T, I > & | setRequired (bool req) |
CServiceDependency< T, I > & | setStrategy (DependencyUpdateStrategy strategy) |
CServiceDependency< T, I > & | setCallbacks (void(T::*set)(const I *service)) |
CServiceDependency< T, I > & | setCallbacks (void(T::*set)(const I *service, Properties &&properties)) |
CServiceDependency< T, I > & | setCallbacks (std::function< void(const I *service, Properties &&properties)> set) |
CServiceDependency< T, I > & | setCallbacks (void(T::*add)(const I *service), void(T::*remove)(const I *service)) |
CServiceDependency< T, I > & | setCallbacks (void(T::*add)(const I *service, Properties &&properties), void(T::*remove)(const I *service, Properties &&properties)) |
CServiceDependency< T, I > & | setCallbacks (std::function< void(const I *service, Properties &&properties)> add, std::function< void(const I *service, Properties &&properties)> remove) |
CServiceDependency< T, I > & | setAddLanguageFilter (bool addLang) |
CServiceDependency< T, I > & | build () |
CServiceDependency< T, I > & | buildAsync () |
Public Member Functions inherited from celix::dm::TypedServiceDependency< T > | |
TypedServiceDependency (celix_dm_component_t *cCmp) | |
~TypedServiceDependency () override=default | |
TypedServiceDependency (const TypedServiceDependency &)=delete | |
TypedServiceDependency & | operator= (const TypedServiceDependency &)=delete |
TypedServiceDependency (TypedServiceDependency &&) noexcept=delete | |
TypedServiceDependency & | operator= (TypedServiceDependency &&) noexcept=delete |
void | setComponentInstance (T *cmp) |
Public Member Functions inherited from celix::dm::BaseServiceDependency | |
BaseServiceDependency (celix_dm_component_t *c) | |
virtual | ~BaseServiceDependency () noexcept |
BaseServiceDependency (const BaseServiceDependency &)=delete | |
BaseServiceDependency & | operator= (const BaseServiceDependency &)=delete |
BaseServiceDependency (BaseServiceDependency &&) noexcept=delete | |
BaseServiceDependency & | operator= (BaseServiceDependency &&) noexcept=delete |
bool | isValid () const __attribute__((deprecated)) |
celix_dm_service_dependency_t * | cServiceDependency () const |
void | wait () const |
void | runBuild () |
Additional Inherited Members | |
Protected Member Functions inherited from celix::dm::BaseServiceDependency | |
void | setDepStrategy (DependencyUpdateStrategy strategy) |
template<typename U > | |
void | waitForExpired (std::weak_ptr< U > observe, long svcId, const char *observeType) |
Protected Attributes inherited from celix::dm::TypedServiceDependency< T > | |
T * | componentInstance {nullptr} |
Protected Attributes inherited from celix::dm::BaseServiceDependency | |
celix_dm_service_dependency_t * | cServiceDep {nullptr} |
A service dependency for a component.
T | The component type |
I | The service interface type |
CServiceDependency::CServiceDependency | ( | celix_dm_component_t * | cCmp, |
const std::string & | name | ||
) |
|
overridedefault |
|
delete |
|
deletenoexcept |
CServiceDependency< T, I > & CServiceDependency::build |
"Build" the service dependency. When build the service dependency is active and the service tracker is created.
Should not be called on the Celix event thread.
CServiceDependency< T, I > & CServiceDependency::buildAsync |
Same a build, but will not wait till the underlining service tracker is created. Can be called on the Celix event thread.
|
delete |
|
deletenoexcept |
CServiceDependency< T, I > & CServiceDependency::setAddLanguageFilter | ( | bool | addLang | ) |
Specify if the service dependency should add a service.lang filter part if it is not already present For C service dependencies 'service.lang=C' will be added.
CServiceDependency< T, I > & CServiceDependency::setCallbacks | ( | std::function< void(const I *service, Properties &&properties)> | add, |
std::function< void(const I *service, Properties &&properties)> | remove | ||
) |
Set the add and remove callback for when the services of service dependency are added or removed.
CServiceDependency< T, I > & CServiceDependency::setCallbacks | ( | std::function< void(const I *service, Properties &&properties)> | set | ) |
Set the set callback for when the service dependency becomes available
CServiceDependency< T, I > & CServiceDependency::setCallbacks | ( | void(T::*)(const I *service) | add, |
void(T::*)(const I *service) | remove | ||
) |
Set the add and remove callback for when the services of service dependency are added or removed.
CServiceDependency< T, I > & CServiceDependency::setCallbacks | ( | void(T::*)(const I *service, Properties &&properties) | add, |
void(T::*)(const I *service, Properties &&properties) | remove | ||
) |
Set the add and remove callback for when the services of service dependency are added or removed.
CServiceDependency< T, I > & CServiceDependency::setCallbacks | ( | void(T::*)(const I *service) | set | ) |
Set the set callback for when the service dependency becomes available
CServiceDependency< T, I > & CServiceDependency::setCallbacks | ( | void(T::*)(const I *service, Properties &&properties) | set | ) |
Set the set callback for when the service dependency becomes available
CServiceDependency< T, I > & CServiceDependency::setFilter | ( | const std::string & | filter | ) |
Sets the service filter for the C service dependency.
filter | The (additional) filter to use (e.g. "(location=front)") |
CServiceDependency< T, I > & CServiceDependency::setRequired | ( | bool | req | ) |
Specify if the service dependency is required. Default is false
CServiceDependency< T, I > & CServiceDependency::setStrategy | ( | DependencyUpdateStrategy | strategy | ) |
Specify if the update strategy to use
CServiceDependency< T, I > & CServiceDependency::setVersionRange | ( | const std::string & | serviceVersionRange | ) |
Sets the service version range for the C service dependency.
serviceVersionRange | The service version range, can be an empty string |