A reference to a service. More...
Public Types | |
typedef S | ServiceType |
Public Member Functions | |
ServiceReference () | |
Creates an invalid ServiceReference object. More... | |
ServiceReference (const ServiceReferenceBase &base) | |
Public Member Functions inherited from ServiceReferenceBase | |
ServiceReferenceBase (const ServiceReferenceBase &ref) | |
operator bool_type () const | |
Converts this ServiceReferenceBase instance into a boolean expression. More... | |
ServiceReferenceBase & | operator= (std::nullptr_t) |
Releases any resources held or locked by this ServiceReferenceBase and renders it invalid. More... | |
~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. More... | |
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. More... | |
Module * | GetModule () const |
Returns the module that registered the service referenced by this ServiceReferenceBase object. More... | |
void | GetUsingModules (std::vector< Module * > &modules) const |
Returns the modules that are using the service referenced by this ServiceReferenceBase object. More... | |
std::string | GetInterfaceId () const |
Returns the interface identifier this ServiceReferenceBase object is bound to. More... | |
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. More... | |
bool | operator< (const ServiceReferenceBase &reference) const |
Compares this ServiceReferenceBase with the specified ServiceReferenceBase for order. More... | |
bool | operator== (const ServiceReferenceBase &reference) const |
ServiceReferenceBase & | operator= (const ServiceReferenceBase &reference) |
A reference to a service.
The framework returns ServiceReference
objects from the ModuleContext::GetServiceReference
and ModuleContext::GetServiceReferences
methods.
A ServiceReference
object may be shared between modules and can be used to examine the properties of the service and to get the service object.
Every service registered in the framework has a unique ServiceRegistration
object and may have multiple, distinct ServiceReference
objects referring to it. ServiceReference
objects associated with a ServiceRegistration
are considered equal (more specifically, their operator==()
method will return true
when compared).
If the same service object is registered multiple times, ServiceReference
objects associated with different ServiceRegistration
objects are not equal.
S | The class type of the service interface |
typedef S ServiceReference< S >::ServiceType |
|
inline |
Creates an invalid ServiceReference object.
You can use this object in boolean expressions and it will evaluate to false
.
|
inline |