C++ Micro Services  2.1.1
A dynamic OSGi-like C++ service registry
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
ServiceReferenceBase Class Reference

A reference to a service. More...

Inheritance diagram for ServiceReferenceBase:
Inheritance graph
[legend]

Public Member Functions

 ServiceReferenceBase (const ServiceReferenceBase &ref)
 operator bool_type () const
 Converts this ServiceReferenceBase instance into a boolean expression.
ServiceReferenceBaseoperator= (int null)
 Releases any resources held or locked by this ServiceReferenceBase and renders it invalid.
 ~ServiceReferenceBase ()
Any GetProperty (const std::string &key) const
 Returns the property value to which the specified property key is mapped in the properties ServiceProperties object of the service referenced by this ServiceReferenceBase object.
void GetPropertyKeys (std::vector< std::string > &keys) const
 Returns a list of the keys in the ServiceProperties object of the service referenced by this ServiceReferenceBase object.
ModuleGetModule () const
 Returns the module that registered the service referenced by this ServiceReferenceBase object.
void GetUsingModules (std::vector< Module * > &modules) const
 Returns the modules that are using the service referenced by this ServiceReferenceBase object.
std::string GetInterfaceId () const
 Returns the interface identifier this ServiceReferenceBase object is bound to.
bool IsConvertibleTo (const std::string &interfaceid) const
 Checks wether this ServiceReferenceBase object can be converted to another ServiceReferenceBase object, which will be bound to the given interface identifier.
bool operator< (const ServiceReferenceBase &reference) const
 Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order.
bool operator== (const ServiceReferenceBase &reference) const
ServiceReferenceBaseoperator= (const ServiceReferenceBase &reference)
 ServiceReferenceBase (const ServiceReferenceBase &ref)
 operator bool_type () const
 Converts this ServiceReferenceBase instance into a boolean expression.
ServiceReferenceBaseoperator= (int null)
 Releases any resources held or locked by this ServiceReferenceBase and renders it invalid.
 ~ServiceReferenceBase ()
Any GetProperty (const std::string &key) const
 Returns the property value to which the specified property key is mapped in the properties ServiceProperties object of the service referenced by this ServiceReferenceBase object.
void GetPropertyKeys (std::vector< std::string > &keys) const
 Returns a list of the keys in the ServiceProperties object of the service referenced by this ServiceReferenceBase object.
ModuleGetModule () const
 Returns the module that registered the service referenced by this ServiceReferenceBase object.
void GetUsingModules (std::vector< Module * > &modules) const
 Returns the modules that are using the service referenced by this ServiceReferenceBase object.
std::string GetInterfaceId () const
 Returns the interface identifier this ServiceReferenceBase object is bound to.
bool IsConvertibleTo (const std::string &interfaceid) const
 Checks wether this ServiceReferenceBase object can be converted to another ServiceReferenceBase object, which will be bound to the given interface identifier.
bool operator< (const ServiceReferenceBase &reference) const
 Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order.
bool operator== (const ServiceReferenceBase &reference) const
ServiceReferenceBaseoperator= (const ServiceReferenceBase &reference)
 ServiceReferenceBase (const ServiceReferenceBase &ref)
 operator bool_type () const
 Converts this ServiceReferenceBase instance into a boolean expression.
ServiceReferenceBaseoperator= (int null)
 Releases any resources held or locked by this ServiceReferenceBase and renders it invalid.
 ~ServiceReferenceBase ()
Any GetProperty (const std::string &key) const
 Returns the property value to which the specified property key is mapped in the properties ServiceProperties object of the service referenced by this ServiceReferenceBase object.
void GetPropertyKeys (std::vector< std::string > &keys) const
 Returns a list of the keys in the ServiceProperties object of the service referenced by this ServiceReferenceBase object.
ModuleGetModule () const
 Returns the module that registered the service referenced by this ServiceReferenceBase object.
void GetUsingModules (std::vector< Module * > &modules) const
 Returns the modules that are using the service referenced by this ServiceReferenceBase object.
std::string GetInterfaceId () const
 Returns the interface identifier this ServiceReferenceBase object is bound to.
bool IsConvertibleTo (const std::string &interfaceid) const
 Checks wether this ServiceReferenceBase object can be converted to another ServiceReferenceBase object, which will be bound to the given interface identifier.
bool operator< (const ServiceReferenceBase &reference) const
 Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order.
bool operator== (const ServiceReferenceBase &reference) const
ServiceReferenceBaseoperator= (const ServiceReferenceBase &reference)

Detailed Description

A reference to a service.

Note
This class is provided as public API for low-level service queries only. In almost all cases you should use the template ServiceReference instead.

Constructor & Destructor Documentation

ServiceReferenceBase::ServiceReferenceBase ( const ServiceReferenceBase ref)
ServiceReferenceBase::~ServiceReferenceBase ( )
ServiceReferenceBase::ServiceReferenceBase ( const ServiceReferenceBase ref)
ServiceReferenceBase::~ServiceReferenceBase ( )
ServiceReferenceBase::ServiceReferenceBase ( const ServiceReferenceBase ref)
ServiceReferenceBase::~ServiceReferenceBase ( )

Member Function Documentation

std::string ServiceReferenceBase::GetInterfaceId ( ) const

Returns the interface identifier this ServiceReferenceBase object is bound to.

A default constructed ServiceReferenceBase object is not bound to any interface identifier and calling this method will return an empty string.

Returns
The interface identifier for this ServiceReferenceBase object.
std::string ServiceReferenceBase::GetInterfaceId ( ) const

Returns the interface identifier this ServiceReferenceBase object is bound to.

A default constructed ServiceReferenceBase object is not bound to any interface identifier and calling this method will return an empty string.

Returns
The interface identifier for this ServiceReferenceBase object.
std::string ServiceReferenceBase::GetInterfaceId ( ) const

Returns the interface identifier this ServiceReferenceBase object is bound to.

A default constructed ServiceReferenceBase object is not bound to any interface identifier and calling this method will return an empty string.

Returns
The interface identifier for this ServiceReferenceBase object.
Module* ServiceReferenceBase::GetModule ( ) const

Returns the module that registered the service referenced by this ServiceReferenceBase object.

This method must return 0 when the service has been unregistered. This can be used to determine if the service has been unregistered.

Returns
The module that registered the service referenced by this ServiceReferenceBase object; 0 if that service has already been unregistered.
See Also
ModuleContext::RegisterService(const InterfaceMap&, const ServiceProperties&)
Module* ServiceReferenceBase::GetModule ( ) const

Returns the module that registered the service referenced by this ServiceReferenceBase object.

This method must return 0 when the service has been unregistered. This can be used to determine if the service has been unregistered.

Returns
The module that registered the service referenced by this ServiceReferenceBase object; 0 if that service has already been unregistered.
See Also
ModuleContext::RegisterService(const InterfaceMap&, const ServiceProperties&)
Module* ServiceReferenceBase::GetModule ( ) const

Returns the module that registered the service referenced by this ServiceReferenceBase object.

This method must return 0 when the service has been unregistered. This can be used to determine if the service has been unregistered.

Returns
The module that registered the service referenced by this ServiceReferenceBase object; 0 if that service has already been unregistered.
See Also
ModuleContext::RegisterService(const InterfaceMap&, const ServiceProperties&)
Any ServiceReferenceBase::GetProperty ( const std::string &  key) const

Returns the property value to which the specified property key is mapped in the properties ServiceProperties object of the service referenced by this ServiceReferenceBase object.

Property keys are case-insensitive.

This method continues to return property values after the service has been unregistered. This is so references to unregistered services can still be interrogated.

Parameters
keyThe property key.
Returns
The property value to which the key is mapped; an invalid Any if there is no property named after the key.
Any ServiceReferenceBase::GetProperty ( const std::string &  key) const

Returns the property value to which the specified property key is mapped in the properties ServiceProperties object of the service referenced by this ServiceReferenceBase object.

Property keys are case-insensitive.

This method continues to return property values after the service has been unregistered. This is so references to unregistered services can still be interrogated.

Parameters
keyThe property key.
Returns
The property value to which the key is mapped; an invalid Any if there is no property named after the key.
Any ServiceReferenceBase::GetProperty ( const std::string &  key) const

Returns the property value to which the specified property key is mapped in the properties ServiceProperties object of the service referenced by this ServiceReferenceBase object.

Property keys are case-insensitive.

This method continues to return property values after the service has been unregistered. This is so references to unregistered services can still be interrogated.

Parameters
keyThe property key.
Returns
The property value to which the key is mapped; an invalid Any if there is no property named after the key.
void ServiceReferenceBase::GetPropertyKeys ( std::vector< std::string > &  keys) const

Returns a list of the keys in the ServiceProperties object of the service referenced by this ServiceReferenceBase object.

This method will continue to return the keys after the service has been unregistered. This is so references to unregistered services can still be interrogated.

Parameters
keysA vector being filled with the property keys.
void ServiceReferenceBase::GetPropertyKeys ( std::vector< std::string > &  keys) const

Returns a list of the keys in the ServiceProperties object of the service referenced by this ServiceReferenceBase object.

This method will continue to return the keys after the service has been unregistered. This is so references to unregistered services can still be interrogated.

Parameters
keysA vector being filled with the property keys.
void ServiceReferenceBase::GetPropertyKeys ( std::vector< std::string > &  keys) const

Returns a list of the keys in the ServiceProperties object of the service referenced by this ServiceReferenceBase object.

This method will continue to return the keys after the service has been unregistered. This is so references to unregistered services can still be interrogated.

Parameters
keysA vector being filled with the property keys.
void ServiceReferenceBase::GetUsingModules ( std::vector< Module * > &  modules) const

Returns the modules that are using the service referenced by this ServiceReferenceBase object.

Specifically, this method returns the modules whose usage count for that service is greater than zero.

Parameters
modulesA list of modules whose usage count for the service referenced by this ServiceReferenceBase object is greater than zero.
void ServiceReferenceBase::GetUsingModules ( std::vector< Module * > &  modules) const

Returns the modules that are using the service referenced by this ServiceReferenceBase object.

Specifically, this method returns the modules whose usage count for that service is greater than zero.

Parameters
modulesA list of modules whose usage count for the service referenced by this ServiceReferenceBase object is greater than zero.
void ServiceReferenceBase::GetUsingModules ( std::vector< Module * > &  modules) const

Returns the modules that are using the service referenced by this ServiceReferenceBase object.

Specifically, this method returns the modules whose usage count for that service is greater than zero.

Parameters
modulesA list of modules whose usage count for the service referenced by this ServiceReferenceBase object is greater than zero.
bool ServiceReferenceBase::IsConvertibleTo ( const std::string &  interfaceid) const

Checks wether this ServiceReferenceBase object can be converted to another ServiceReferenceBase object, which will be bound to the given interface identifier.

ServiceReferenceBase objects can be converted if the underlying service implementation was registered under multiple service interfaces.

Parameters
interfaceid
Returns
true if this ServiceReferenceBase object can be converted, false otherwise.
bool ServiceReferenceBase::IsConvertibleTo ( const std::string &  interfaceid) const

Checks wether this ServiceReferenceBase object can be converted to another ServiceReferenceBase object, which will be bound to the given interface identifier.

ServiceReferenceBase objects can be converted if the underlying service implementation was registered under multiple service interfaces.

Parameters
interfaceid
Returns
true if this ServiceReferenceBase object can be converted, false otherwise.
bool ServiceReferenceBase::IsConvertibleTo ( const std::string &  interfaceid) const

Checks wether this ServiceReferenceBase object can be converted to another ServiceReferenceBase object, which will be bound to the given interface identifier.

ServiceReferenceBase objects can be converted if the underlying service implementation was registered under multiple service interfaces.

Parameters
interfaceid
Returns
true if this ServiceReferenceBase object can be converted, false otherwise.
ServiceReferenceBase::operator bool_type ( ) const

Converts this ServiceReferenceBase instance into a boolean expression.

If this instance was default constructed or the service it references has been unregistered, the conversion returns false, otherwise it returns true.

ServiceReferenceBase::operator bool_type ( ) const

Converts this ServiceReferenceBase instance into a boolean expression.

If this instance was default constructed or the service it references has been unregistered, the conversion returns false, otherwise it returns true.

ServiceReferenceBase::operator bool_type ( ) const

Converts this ServiceReferenceBase instance into a boolean expression.

If this instance was default constructed or the service it references has been unregistered, the conversion returns false, otherwise it returns true.

bool ServiceReferenceBase::operator< ( const ServiceReferenceBase reference) const

Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order.

If this ServiceReferenceBase and the specified ServiceReferenceBase have the same service id they are equal. This ServiceReferenceBase is less than the specified ServiceReferenceBase if it has a lower service ranking and greater if it has a higher service ranking. Otherwise, if this ServiceReferenceBase and the specified ServiceReferenceBase have the same service ranking, this ServiceReferenceBase is less than the specified ServiceReferenceBase if it has a higher service id and greater if it has a lower service id.

Parameters
referenceThe ServiceReferenceBase to be compared.
Returns
Returns a false or true if this ServiceReferenceBase is less than or greater than the specified ServiceReferenceBase.
bool ServiceReferenceBase::operator< ( const ServiceReferenceBase reference) const

Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order.

If this ServiceReferenceBase and the specified ServiceReferenceBase have the same service id they are equal. This ServiceReferenceBase is less than the specified ServiceReferenceBase if it has a lower service ranking and greater if it has a higher service ranking. Otherwise, if this ServiceReferenceBase and the specified ServiceReferenceBase have the same service ranking, this ServiceReferenceBase is less than the specified ServiceReferenceBase if it has a higher service id and greater if it has a lower service id.

Parameters
referenceThe ServiceReferenceBase to be compared.
Returns
Returns a false or true if this ServiceReferenceBase is less than or greater than the specified ServiceReferenceBase.
bool ServiceReferenceBase::operator< ( const ServiceReferenceBase reference) const

Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order.

If this ServiceReferenceBase and the specified ServiceReferenceBase have the same service id they are equal. This ServiceReferenceBase is less than the specified ServiceReferenceBase if it has a lower service ranking and greater if it has a higher service ranking. Otherwise, if this ServiceReferenceBase and the specified ServiceReferenceBase have the same service ranking, this ServiceReferenceBase is less than the specified ServiceReferenceBase if it has a higher service id and greater if it has a lower service id.

Parameters
referenceThe ServiceReferenceBase to be compared.
Returns
Returns a false or true if this ServiceReferenceBase is less than or greater than the specified ServiceReferenceBase.
ServiceReferenceBase& ServiceReferenceBase::operator= ( int  null)

Releases any resources held or locked by this ServiceReferenceBase and renders it invalid.

ServiceReferenceBase& ServiceReferenceBase::operator= ( int  null)

Releases any resources held or locked by this ServiceReferenceBase and renders it invalid.

ServiceReferenceBase& ServiceReferenceBase::operator= ( int  null)

Releases any resources held or locked by this ServiceReferenceBase and renders it invalid.

ServiceReferenceBase& ServiceReferenceBase::operator= ( const ServiceReferenceBase reference)
ServiceReferenceBase& ServiceReferenceBase::operator= ( const ServiceReferenceBase reference)
ServiceReferenceBase& ServiceReferenceBase::operator= ( const ServiceReferenceBase reference)
bool ServiceReferenceBase::operator== ( const ServiceReferenceBase reference) const
bool ServiceReferenceBase::operator== ( const ServiceReferenceBase reference) const
bool ServiceReferenceBase::operator== ( const ServiceReferenceBase reference) const