Apache Celix  2.3.0
An implementation of the OSGi specification adapted to C and C++
Public Member Functions | List of all members
celix::dm::ProvidedService< T, I > Class Template Reference

#include <ProvidedService.h>

Inheritance diagram for celix::dm::ProvidedService< T, I >:
Inheritance graph
[legend]
Collaboration diagram for celix::dm::ProvidedService< T, I >:
Collaboration graph
[legend]

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
 
BaseProvidedServiceoperator= (BaseProvidedService &&)=delete
 
 BaseProvidedService (const BaseProvidedService &)=delete
 
BaseProvidedServiceoperator= (const BaseProvidedService &)=delete
 
const std::string & getName () const
 
const std::string & getVersion () const
 
bool isCppService () const
 
void * getService () const
 
const celix::dm::PropertiesgetProperties () 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}
 

Constructor & Destructor Documentation

◆ ProvidedService()

template<typename T , typename I >
ProvidedService::ProvidedService ( celix_dm_component_t *  _cmp,
std::string  svcName,
std::shared_ptr< I >  svc,
bool  _cppService 
)

Member Function Documentation

◆ addProperty() [1/4]

template<typename T , typename I >
ProvidedService< T, I > & ProvidedService::addProperty ( const std::string &  key,
const char *  value 
)

Add/override a single property to the service properties.

◆ addProperty() [2/4]

template<typename T , typename I >
ProvidedService< T, I > & ProvidedService::addProperty ( const std::string &  key,
const std::string &  value 
)

Add/override a single property to the service properties.

◆ addProperty() [3/4]

template<typename T , typename I >
template<typename U >
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.

◆ addProperty() [4/4]

template<typename T , typename I >
template<typename U >
ProvidedService<T, I>& celix::dm::ProvidedService< T, I >::addProperty ( const std::string &  key,
const U &  value 
)

◆ build()

template<typename T , typename I >
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.

◆ buildAsync()

template<typename T , typename I >
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.

◆ setProperties()

template<typename T , typename I >
ProvidedService< T, I > & ProvidedService::setProperties ( celix::dm::Properties  p)

Set the properties of the interface. Note this will reset the already set / added properties

◆ setVersion()

template<typename T , typename I >
ProvidedService< T, I > & celix::dm::ProvidedService< T, I >::setVersion ( std::string  v)

Set the version of the interface


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