Fluent builder API to track services.
More...
#include <TrackerBuilders.h>
|
| ServiceTrackerBuilder (std::shared_ptr< celix_bundle_context_t > _cCtx, std::string _name) |
|
ServiceTrackerBuilder & | operator= (ServiceTrackerBuilder &&)=delete |
|
| ServiceTrackerBuilder (const ServiceTrackerBuilder &)=delete |
|
ServiceTrackerBuilder | operator= (const ServiceTrackerBuilder &)=delete |
|
ServiceTrackerBuilder & | setFilter (std::string_view f) |
| Set filter to be used to matching services. More...
|
|
ServiceTrackerBuilder & | setFilter (celix::Filter f) |
| Set filter to be used to matching services. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addAddCallback (F &&add) |
| Adds a add callback function, which will be called - on the Celix event thread - when a new service match is found. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addAddWithPropertiesCallback (F &&add) |
| Adds a add callback function, which will be called - on the Celix event thread - when a new service match is found. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addAddWithOwnerCallback (F &&add) |
| Adds a add callback function, which will be called - on the Celix event thread - when a new service match is found. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addRemCallback (F &&remove) |
| Adds a remove callback function, which will be called - on the Celix event thread - when a service match is being removed. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addRemWithPropertiesCallback (F &&remove) |
| Adds a remove callback function, which will be called - on the Celix event thread - when a service match is being removed. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addRemWithOwnerCallback (F &&remove) |
| Adds a remove callback function, which will be called - on the Celix event thread - when a service match is being removed. More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addSetCallback (F &&set) |
| Adds a set callback function, which will be called - on the Celix event thread - when there is a new highest ranking service match. This can can also be an empty match (nullptr). More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addSetWithPropertiesCallback (F &&set) |
| Adds a set callback function, which will be called - on the Celix event thread - when there is a new highest ranking service match. This can can also be an empty match (nullptr). More...
|
|
template<typename F > |
ServiceTrackerBuilder & | addSetWithOwner (F &&set) |
| Adds a set callback function, which will be called - on the Celix event thread - when there is a new highest ranking service match. This can can also be an empty match (nullptr). More...
|
|
std::shared_ptr< ServiceTracker< I > > | build () |
| "Builds" the service tracker and returns a ServiceTracker. More...
|
|
template<typename I>
class celix::ServiceTrackerBuilder< I >
Fluent builder API to track services.
- See also
- celix::BundleContext::trackServices for more info.
- Template Parameters
-
I | The service type to track. |
- Note
- Not thread safe.
◆ ServiceTrackerBuilder() [1/2]
◆ ServiceTrackerBuilder() [2/2]
◆ addAddCallback()
template<typename I >
template<typename F >
Adds a add callback function, which will be called - on the Celix event thread - when a new service match is found.
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service)> |
- Parameters
-
add | The callback function which will be called when a new service is found. |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addAddWithOwnerCallback()
template<typename I >
template<typename F >
Adds a add callback function, which will be called - on the Celix event thread - when a new service match is found.
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service, const std::shared_ptr<const celix::Properties>& properties, const std::shared_ptr<const celix::Bundle>&)> |
- Parameters
-
add | The callback function which will be called when a new service is found. |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addAddWithPropertiesCallback()
template<typename I >
template<typename F >
Adds a add callback function, which will be called - on the Celix event thread - when a new service match is found.
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service, const std::shared_ptr<const celix::Properties>& properties)> |
- Parameters
-
add | The callback function which will be called when a new service is found. |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addRemCallback()
template<typename I >
template<typename F >
Adds a remove callback function, which will be called - on the Celix event thread - when a service match is being removed.
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service)> |
- Parameters
-
remove | The callback function which will be called when a added service is being removed. |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addRemWithOwnerCallback()
template<typename I >
template<typename F >
Adds a remove callback function, which will be called - on the Celix event thread - when a service match is being removed.
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service, const std::shared_ptr<const celix::Properties>& properties, const std::shared_ptr<const celix::Bundle>&)> |
- Parameters
-
remove | The callback function which will be called when a added service is being removed. |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addRemWithPropertiesCallback()
template<typename I >
template<typename F >
Adds a remove callback function, which will be called - on the Celix event thread - when a service match is being removed.
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service, const std::shared_ptr<const celix::Properties>& properties)> |
- Parameters
-
remove | The callback function which will be called when a added service is being removed. |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addSetCallback()
template<typename I >
template<typename F >
Adds a set callback function, which will be called - on the Celix event thread - when there is a new highest ranking service match. This can can also be an empty match (nullptr).
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service)> |
- Parameters
-
set | The callback function which will be called when a new highest ranking service is found or when the last matching service is being removed (svc and properties will be a nullptr). |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addSetWithOwner()
template<typename I >
template<typename F >
Adds a set callback function, which will be called - on the Celix event thread - when there is a new highest ranking service match. This can can also be an empty match (nullptr).
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service, const std::shared_ptr<const celix::Properties>& properties, const std::shared_ptr<const celix::Bundle>&)>> |
- Parameters
-
set | The callback function which will be called when a new highest ranking service is found or when the last matching service is being removed (svc and properties will be a nullptr). |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ addSetWithPropertiesCallback()
template<typename I >
template<typename F >
Adds a set callback function, which will be called - on the Celix event thread - when there is a new highest ranking service match. This can can also be an empty match (nullptr).
- Template Parameters
-
F | The callback function type. Signature should be compatible with std::function<void(const std::share_ptr<I>& service, const std::shared_ptr<const celix::Properties>& properties)> |
- Parameters
-
set | The callback function which will be called when a new highest ranking service is found or when the last matching service is being removed (svc and properties will be a nullptr). |
- Returns
- The ServiceTrackerBuilder reference for chaining (Fluent API).
◆ build()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setFilter() [1/2]
Set filter to be used to matching services.
◆ setFilter() [2/2]
Set filter to be used to matching services.
The filter must be LDAP filter. Example: "(property_key=value)"
◆ BundleContext
The documentation for this class was generated from the following file: