CppMicroServices

C++ Micro Services: ServiceObjects< void > Class Template Reference
ServiceObjects< void > Class Template Reference

Allows multiple service objects for a service to be obtained. More...

Inheritance diagram for ServiceObjects< void >:
Collaboration diagram for ServiceObjects< void >:

Public Member Functions

InterfaceMap GetService () const
 Returns a service object as a InterfaceMap instance for the referenced service. More...
 
void UngetService (const InterfaceMap &service)
 Releases a service object for the referenced service. More...
 
ServiceReferenceU GetServiceReference () const
 Returns the ServiceReference for this ServiceObjects object. More...
 

Detailed Description

template<>
class ServiceObjects< void >

Allows multiple service objects for a service to be obtained.

This is a specialization of the ServiceObjects class template for "void", which maps to all service interface types.

See also
ServiceObjects

Member Function Documentation

InterfaceMap ServiceObjects< void >::GetService ( ) const

Returns a service object as a InterfaceMap instance for the referenced service.

This method is the same as ServiceObjects<S>::GetService() except for the return type. Further, this method will always return an empty InterfaeMap object when the referenced service has been unregistered.

Returns
A InterfaceMap object for the referenced service, which is empty if the service is not registered, the InterfaceMap returned by a ServiceFactory does not contain all the classes under which the service object was registered or the ServiceFactory threw an exception.
Exceptions
std::logic_errorIf the ModuleContext used to create this ServiceObjects object is no longer valid.
See also
ServiceObjects<S>::GetService()
UngetService()
ServiceReferenceU ServiceObjects< void >::GetServiceReference ( ) const

Returns the ServiceReference for this ServiceObjects object.

Returns
The ServiceReference for this ServiceObjects object.
void ServiceObjects< void >::UngetService ( const InterfaceMap service)

Releases a service object for the referenced service.

This method is the same as ServiceObjects<S>::UngetService() except for the parameter type.

Parameters
serviceAn InterfaceMap object previously provided by this ServiceObjects object.
Exceptions
std::logic_errorIf the ModuleContext used to create this ServiceObjects object is no longer valid.
std::invalid_argumentIf the specified service was not provided by this ServiceObjects object.
See also
ServiceObjects<S>::UngetService()
GetService()