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 | Friends | List of all members
celix::MetaTrackerBuilder Class Reference

Fluent builder API to track service trackers. More...

#include <TrackerBuilders.h>

Public Member Functions

 MetaTrackerBuilder (std::shared_ptr< celix_bundle_context_t > _cCtx, std::string _serviceName)
 
MetaTrackerBuilderoperator= (MetaTrackerBuilder &&)=delete
 
 MetaTrackerBuilder (const MetaTrackerBuilder &)=delete
 
MetaTrackerBuilder operator= (const MetaTrackerBuilder &)=delete
 
MetaTrackerBuilderaddOnTrackerCreatedCallback (std::function< void(const ServiceTrackerInfo &)> cb)
 Adds a "on tracker created" callback function, which will be called - on the Celix event thread - when a new service tracker has been created. More...
 
MetaTrackerBuilderaddOnTrackerDestroyedCallback (std::function< void(const ServiceTrackerInfo &)> cb)
 Adds a "on tracker destroyed" callback function, which will be called - on the Celix event thread - when a new service tracker has been destroyed. More...
 
std::shared_ptr< MetaTrackerbuild ()
 "Builds" the meta tracker and returns a MetaTracker. More...
 

Friends

class BundleContext
 

Detailed Description

Fluent builder API to track service trackers.

See also
See celix::BundleContext::trackServiceTrackers for more info.
Note
Not thread safe.

Constructor & Destructor Documentation

◆ MetaTrackerBuilder() [1/2]

celix::MetaTrackerBuilder::MetaTrackerBuilder ( std::shared_ptr< celix_bundle_context_t >  _cCtx,
std::string  _serviceName 
)
inlineexplicit

◆ MetaTrackerBuilder() [2/2]

celix::MetaTrackerBuilder::MetaTrackerBuilder ( const MetaTrackerBuilder )
delete

Member Function Documentation

◆ addOnTrackerCreatedCallback()

MetaTrackerBuilder& celix::MetaTrackerBuilder::addOnTrackerCreatedCallback ( std::function< void(const ServiceTrackerInfo &)>  cb)
inline

Adds a "on tracker created" callback function, which will be called - on the Celix event thread - when a new service tracker has been created.

The "on tracker created" callback function has 1 arguments: A const reference to a ServiceTrackerInfo object.

◆ addOnTrackerDestroyedCallback()

MetaTrackerBuilder& celix::MetaTrackerBuilder::addOnTrackerDestroyedCallback ( std::function< void(const ServiceTrackerInfo &)>  cb)
inline

Adds a "on tracker destroyed" callback function, which will be called - on the Celix event thread - when a new service tracker has been destroyed.

The "on tracker destroyed" callback function has 1 arguments: A const reference to a ServiceTrackerInfo object.

◆ build()

std::shared_ptr<MetaTracker> celix::MetaTrackerBuilder::build ( )
inline

"Builds" the meta tracker and returns a MetaTracker.

The MetaTracker will be started async.

◆ operator=() [1/2]

MetaTrackerBuilder celix::MetaTrackerBuilder::operator= ( const MetaTrackerBuilder )
delete

◆ operator=() [2/2]

MetaTrackerBuilder& celix::MetaTrackerBuilder::operator= ( MetaTrackerBuilder &&  )
delete

Friends And Related Function Documentation

◆ BundleContext

friend class BundleContext
friend

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