Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
us::ServiceConstants Namespace Reference

Functions

const US_Core_EXPORT std::string & OBJECTCLASS ()
 
const US_Core_EXPORT std::string & SERVICE_ID ()
 
const US_Core_EXPORT std::string & SERVICE_RANKING ()
 
const US_Core_EXPORT std::string & SERVICE_SCOPE ()
 
const US_Core_EXPORT std::string & SCOPE_SINGLETON ()
 
const US_Core_EXPORT std::string & SCOPE_MODULE ()
 
const US_Core_EXPORT std::string & SCOPE_PROTOTYPE ()
 

Function Documentation

◆ OBJECTCLASS()

const US_Core_EXPORT std::string& us::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.

◆ SCOPE_MODULE()

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

Service scope is module. Each module using the service receives a distinct service object.

See also
SERVICE_SCOPE()

◆ SCOPE_PROTOTYPE()

const US_Core_EXPORT std::string& us::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()

◆ SCOPE_SINGLETON()

const US_Core_EXPORT std::string& us::ServiceConstants::SCOPE_SINGLETON ( )

Service scope is singleton. All modules using the service receive the same service object.

See also
SERVICE_SCOPE()

◆ SERVICE_ID()

const US_Core_EXPORT std::string& us::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.

◆ SERVICE_RANKING()

const US_Core_EXPORT std::string& us::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.

◆ SERVICE_SCOPE()

const US_Core_EXPORT std::string& us::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().