A registered service. More...
Public Member Functions | |
ServiceRegistration () | |
Creates an invalid ServiceRegistration object. More... | |
ServiceRegistration (const ServiceRegistration ®) | |
operator bool () const | |
A boolean conversion operator converting this ServiceRegistration object to true if it is valid and to false otherwise. More... | |
ServiceRegistration & | operator= (int null) |
Releases any resources held or locked by this ServiceRegistration and renders it invalid. More... | |
~ServiceRegistration () | |
ServiceReference | GetReference () const |
Returns a ServiceReference object for a service being registered. More... | |
void | SetProperties (const ServiceProperties &properties) |
Updates the properties associated with a service. More... | |
void | Unregister () |
Unregisters a service. More... | |
bool | operator< (const ServiceRegistration &o) const |
Compare two ServiceRegistration objects. More... | |
bool | operator== (const ServiceRegistration ®istration) const |
ServiceRegistration & | operator= (const ServiceRegistration ®istration) |
A registered service.
The framework returns a ServiceRegistration
object when a ModuleContext::RegisterService()
method invocation is successful. The ServiceRegistration
object is for the private use of the registering module and should not be shared with other modules.
The ServiceRegistration
object may be used to update the properties of the service or to unregister the service.
ServiceRegistration::ServiceRegistration | ( | ) |
Creates an invalid ServiceRegistration object.
You can use this object in boolean expressions and it will evaluate to false
.
ServiceRegistration::ServiceRegistration | ( | const ServiceRegistration & | reg | ) |
ServiceRegistration::~ServiceRegistration | ( | ) |
ServiceReference ServiceRegistration::GetReference | ( | ) | const |
Returns a ServiceReference
object for a service being registered.
The ServiceReference
object may be shared with other modules.
std::logic_error | If this ServiceRegistration object has already been unregistered or if it is invalid. |
ServiceReference
object. ServiceRegistration::operator bool | ( | ) | const |
A boolean conversion operator converting this ServiceRegistration object to true
if it is valid and to false
otherwise.
A SeriveRegistration object is invalid if it was default-constructed or was invalidated by assigning 0 to it.
true
if this ServiceRegistration object is valid, false
otherwise. bool ServiceRegistration::operator< | ( | const ServiceRegistration & | o | ) | const |
Compare two ServiceRegistration objects.
If both ServiceRegistration objects are valid, the comparison is done using the underlying ServiceReference object. Otherwise, this ServiceRegistration object is less than the other object if and only if this object is invalid and the other object is valid.
o | The ServiceRegistration object to compare with. |
true
if this ServiceRegistration object is less than the other object. ServiceRegistration& ServiceRegistration::operator= | ( | int | null | ) |
Releases any resources held or locked by this ServiceRegistration
and renders it invalid.
ServiceRegistration& ServiceRegistration::operator= | ( | const ServiceRegistration & | registration | ) |
bool ServiceRegistration::operator== | ( | const ServiceRegistration & | registration | ) | const |
void ServiceRegistration::SetProperties | ( | const ServiceProperties & | properties | ) |
Updates the properties associated with a service.
The ServiceConstants::OBJECTCLASS and ServiceConstants::SERVICE_ID keys cannot be modified by this method. These values are set by the framework when the service is registered in the environment.
The following steps are taken to modify service properties:
properties | The properties for this service. See ServiceProperties for a list of standard service property keys. Changes should not be made to this object after calling this method. To update the service's properties this method should be called again. |
std::logic_error | If this ServiceRegistration object has already been unregistered or if it is invalid. |
std::invalid_argument | If properties contains case variants of the same key name. |
void ServiceRegistration::Unregister | ( | ) |
Unregisters a service.
Remove a ServiceRegistration
object from the framework service registry. All ServiceRegistration
objects associated with this ServiceRegistration
object can no longer be used to interact with the service once unregistration is complete.
The following steps are taken to unregister a service:
ServiceRegistration
objects for the service may no longer be used to get a service object for the service. ServiceFactory::UngetService
method is called to release the service object for the module. std::logic_error | If this ServiceRegistration object has already been unregistered or if it is invalid. |