CppMicroServices

C++ Micro Services: ServiceRegistration< I1, I2, I3 > Class Template Reference
ServiceRegistration< I1, I2, I3 > Class Template Reference

A registered service. More...

Inheritance diagram for ServiceRegistration< I1, I2, I3 >:
Collaboration diagram for ServiceRegistration< I1, I2, I3 >:

Public Member Functions

 ServiceRegistration ()
 Creates an invalid ServiceRegistration object. More...
 
ServiceReference< I1 > GetReference (InterfaceType< I1 >) const
 Returns a ServiceReference object for a service being registered. More...
 
ServiceReference< I2 > GetReference (InterfaceType< I2 >) const
 Returns a ServiceReference object for a service being registered. More...
 
ServiceReference< I3 > GetReference (InterfaceType< I3 >) const
 Returns a ServiceReference object for a service being registered. More...
 
- Public Member Functions inherited from ServiceRegistrationBase
 ServiceRegistrationBase (const ServiceRegistrationBase &reg)
 
 operator bool_type () const
 A boolean conversion operator converting this ServiceRegistrationBase object to true if it is valid and to false otherwise. More...
 
ServiceRegistrationBaseoperator= (int null)
 Releases any resources held or locked by this ServiceRegistrationBase and renders it invalid. More...
 
 ~ServiceRegistrationBase ()
 
ServiceReferenceBase GetReference (const std::string &interfaceId=std::string()) 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 ServiceRegistrationBase &o) const
 Compare two ServiceRegistrationBase objects. More...
 
bool operator== (const ServiceRegistrationBase &registration) const
 
ServiceRegistrationBaseoperator= (const ServiceRegistrationBase &registration)
 

Detailed Description

template<class I1, class I2 = void, class I3 = void>
class ServiceRegistration< I1, I2, I3 >

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.

Template Parameters
SClass tyoe of the service interface
See Also
ModuleContext::RegisterService()
Remarks
This class is thread safe.

Constructor & Destructor Documentation

template<class I1 , class I2 = void, class I3 = void>
ServiceRegistration< I1, I2, I3 >::ServiceRegistration ( )
inline

Creates an invalid ServiceRegistration object.

You can use this object in boolean expressions and it will evaluate to false.

Member Function Documentation

template<class I1 , class I2 = void, class I3 = void>
ServiceReference<I1> ServiceRegistration< I1, I2, I3 >::GetReference ( InterfaceType< I1 >  ) const
inline

Returns a ServiceReference object for a service being registered.

The ServiceReference object may be shared with other modules.

Exceptions
std::logic_errorIf this ServiceRegistration object has already been unregistered or if it is invalid.
Returns
ServiceReference object.

References ServiceRegistrationBase::GetReference().

template<class I1 , class I2 = void, class I3 = void>
ServiceReference<I2> ServiceRegistration< I1, I2, I3 >::GetReference ( InterfaceType< I2 >  ) const
inline

Returns a ServiceReference object for a service being registered.

The ServiceReference object may be shared with other modules.

Exceptions
std::logic_errorIf this ServiceRegistration object has already been unregistered or if it is invalid.
Returns
ServiceReference object.

References ServiceRegistrationBase::GetReference().

template<class I1 , class I2 = void, class I3 = void>
ServiceReference<I3> ServiceRegistration< I1, I2, I3 >::GetReference ( InterfaceType< I3 >  ) const
inline

Returns a ServiceReference object for a service being registered.

The ServiceReference object may be shared with other modules.

Exceptions
std::logic_errorIf this ServiceRegistration object has already been unregistered or if it is invalid.
Returns
ServiceReference object.

References ServiceRegistrationBase::GetReference().