CppMicroServices

C++ Micro Services: ServiceConstants Namespace Reference
ServiceConstants Namespace Reference

Functions

const std::string & OBJECTCLASS ()
 Service property identifying all of the class names under which a service was registered in the framework. More...
 
const std::string & SERVICE_ID ()
 Service property identifying a service's registration number. More...
 
const std::string & SERVICE_RANKING ()
 Service property identifying a service's ranking number. More...
 

Function Documentation

const std::string& ServiceConstants::OBJECTCLASS ( )

Service property identifying all of the class names under which a service was registered in the framework.

The value of this property must be of type std::list<std::string>.

This property is set by the framework when a service is registered.

const std::string& ServiceConstants::SERVICE_ID ( )

Service property identifying a service's registration number.

The value of this property must be of type long int.

The value of this property is assigned by the framework when a service is registered. The framework assigns a unique value that is larger than all previously assigned values since the framework was started. These values are NOT persistent across restarts of the framework.

const std::string& ServiceConstants::SERVICE_RANKING ( )

Service property identifying a service's ranking number.

This property may be supplied in the ServiceProperties object passed to the ModuleContext::RegisterService method. The value of this property must be of type int.

The service ranking is used by the framework to determine the natural order of services, see ServiceReference::operator<(const ServiceReference&), and the default service to be returned from a call to the ModuleContext::GetServiceReference method.

The default ranking is zero (0). A service with a ranking of std::numeric_limits<int>::max() is very likely to be returned as the default service, whereas a service with a ranking of std::numeric_limits<int>::min() is very unlikely to be returned.

If the supplied property value is not of type int, it is deemed to have a ranking value of zero.