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...
 
const std::string & SERVICE_SCOPE ()
 Service property identifying a service's scope. More...
 
const std::string & SCOPE_SINGLETON ()
 Service scope is singleton. More...
 
const std::string & SCOPE_MODULE ()
 Service scope is module. More...
 
const std::string & SCOPE_PROTOTYPE ()
 Service scope is prototype. 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::vector<std::string>.

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

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

Service scope is module.

Each module using the service receives a distinct service object.

See also
SERVICE_SCOPE()
const std::string& ServiceConstants::SCOPE_PROTOTYPE ( )

Service scope is prototype.

Each module using the service receives either a distinct service object or can request multiple distinct service objects via ServiceObjects.

See also
SERVICE_SCOPE()
const std::string& ServiceConstants::SCOPE_SINGLETON ( )

Service scope is singleton.

All modules using the service receive the same service object.

See also
SERVICE_SCOPE()
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.

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

Service property identifying a service's scope.

This property is set by the framework when a service is registered. If the registered object implements PrototypeServiceFactory, then the value of this service property will be SCOPE_PROTOTYPE(). Otherwise, if the registered object implements ServiceFactory, then the value of this service property will be SCOPE_MODULE(). Otherwise, the value of this service property will be SCOPE_SINGLETON().