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 | |
ServiceDependency (celix_dm_component_t *cCmp, const std::string &name) | |
~ServiceDependency () override=default | |
ServiceDependency (const ServiceDependency &)=delete | |
ServiceDependency & | operator= (const ServiceDependency &)=delete |
ServiceDependency (ServiceDependency &&) noexcept=delete | |
ServiceDependency & | operator= (ServiceDependency &&) noexcept=delete |
ServiceDependency< T, I > & | setName (const std::string &_name) |
ServiceDependency< T, I > & | setFilter (const std::string &filter) |
ServiceDependency< T, I > & | setVersionRange (const std::string &versionRange) |
ServiceDependency< T, I > & | setCallbacks (void(T::*set)(I *service)) |
ServiceDependency< T, I > & | setCallbacks (void(T::*set)(I *service, Properties &&properties)) |
ServiceDependency< T, I > & | setCallbacks (std::function< void(I *service, Properties &&properties)> set) |
ServiceDependency< T, I > & | setCallbacks (void(T::*set)(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)) |
Set the set callback for when the service dependency becomes available using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (std::function< void(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)> set) |
Set the set callback for when the service dependency becomes available using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (void(T::*set)(const std::shared_ptr< I > &service)) |
Set the set callback for when the service dependency becomes available using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (std::function< void(const std::shared_ptr< I > &service)> set) |
Set the set callback for when the service dependency becomes available using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (void(T::*add)(I *service), void(T::*remove)(I *service)) |
ServiceDependency< T, I > & | setCallbacks (void(T::*add)(I *service, Properties &&properties), void(T::*remove)(I *service, Properties &&properties)) |
ServiceDependency< T, I > & | setCallbacks (std::function< void(I *service, Properties &&properties)> add, std::function< void(I *service, Properties &&properties)> remove) |
ServiceDependency< T, I > & | setCallbacks (void(T::*add)(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties), void(T::*remove)(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)) |
Set the add and remove callback for a service dependency using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (std::function< void(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)> add, std::function< void(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)> remove) |
Set the add and remove callback for a service dependency using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (void(T::*add)(const std::shared_ptr< I > &service), void(T::*remove)(const std::shared_ptr< I > &service)) |
Set the add and remove callback for a service dependency using shared pointers. More... | |
ServiceDependency< T, I > & | setCallbacks (std::function< void(const std::shared_ptr< I > &service)> add, std::function< void(const std::shared_ptr< I > &service)> remove) |
Set the add and remove callback for a service dependency using shared pointers. More... | |
ServiceDependency< T, I > & | setRequired (bool req) |
ServiceDependency< T, I > & | setStrategy (DependencyUpdateStrategy strategy) |
ServiceDependency< T, I > & | setAddLanguageFilter (bool addLang) |
ServiceDependency< T, I > & | build () |
ServiceDependency< 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 |
ServiceDependency::ServiceDependency | ( | celix_dm_component_t * | cCmp, |
const std::string & | name | ||
) |
|
overridedefault |
|
delete |
|
deletenoexcept |
ServiceDependency< T, I > & ServiceDependency::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.
ServiceDependency< T, I > & ServiceDependency::buildAsync |
Same a build, but will not wait till the underlining service trackers are opened. Can be called on the Celix event thread.
|
delete |
|
deletenoexcept |
ServiceDependency< T, I > & ServiceDependency::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. Should be called before
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | std::function< void(const std::shared_ptr< I > &service)> | add, |
std::function< void(const std::shared_ptr< I > &service)> | remove | ||
) |
Set the add and remove callback for a service dependency using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | std::function< void(const std::shared_ptr< I > &service)> | set | ) |
Set the set callback for when the service dependency becomes available using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | std::function< void(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)> | add, |
std::function< void(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)> | remove | ||
) |
Set the add and remove callback for a service dependency using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | std::function< void(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties)> | set | ) |
Set the set callback for when the service dependency becomes available using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | std::function< void(I *service, Properties &&properties)> | add, |
std::function< void(I *service, Properties &&properties)> | remove | ||
) |
Set the add and remove callback for when the services of service dependency are added or removed.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | std::function< void(I *service, Properties &&properties)> | set | ) |
Set the set callback for when the service dependency becomes available
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(const std::shared_ptr< I > &service) | add, |
void(T::*)(const std::shared_ptr< I > &service) | remove | ||
) |
Set the add and remove callback for a service dependency using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties) | add, |
void(T::*)(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties) | remove | ||
) |
Set the add and remove callback for a service dependency using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(I *service) | add, |
void(T::*)(I *service) | remove | ||
) |
Set the add and remove callback for when the services of service dependency are added or removed.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(I *service, Properties &&properties) | add, |
void(T::*)(I *service, Properties &&properties) | remove | ||
) |
Set the add and remove callback for when the services of service dependency are added or removed.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(const std::shared_ptr< I > &service) | set | ) |
Set the set callback for when the service dependency becomes available using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(const std::shared_ptr< I > &service, const std::shared_ptr< const celix::Properties > &properties) | set | ) |
Set the set callback for when the service dependency becomes available using shared pointers.
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(I *service) | set | ) |
Set the set callback for when the service dependency becomes available
ServiceDependency< T, I > & ServiceDependency::setCallbacks | ( | void(T::*)(I *service, Properties &&properties) | set | ) |
Set the set callback for when the service dependency becomes available
ServiceDependency< T, I > & ServiceDependency::setFilter | ( | const std::string & | filter | ) |
Set the service filter of the service dependency.
ServiceDependency< T, I > & ServiceDependency::setName | ( | const std::string & | _name | ) |
Set the service name of the service dependency.
ServiceDependency< T, I > & ServiceDependency::setRequired | ( | bool | req | ) |
Specify if the service dependency is required. Default is false
ServiceDependency< T, I > & ServiceDependency::setStrategy | ( | DependencyUpdateStrategy | strategy | ) |
Specify if the update strategy to use
ServiceDependency< T, I > & ServiceDependency::setVersionRange | ( | const std::string & | versionRange | ) |
Set the service version range of the service dependency.