Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <usServiceRegistrationBase.h>
Public Member Functions | |
ServiceRegistrationBase (const ServiceRegistrationBase ®) | |
operator bool_type () const | |
ServiceRegistrationBase & | operator= (int null) |
~ServiceRegistrationBase () | |
ServiceReferenceBase | GetReference (const std::string &interfaceId=std::string()) const |
void | SetProperties (const ServiceProperties &properties) |
void | Unregister () |
bool | operator< (const ServiceRegistrationBase &o) const |
bool | operator== (const ServiceRegistrationBase ®istration) const |
ServiceRegistrationBase & | operator= (const ServiceRegistrationBase ®istration) |
A registered service.
The framework returns a ServiceRegistrationBase
object when a ModuleContext::RegisterService()
method invocation is successful. The ServiceRegistrationBase
object is for the private use of the registering module and should not be shared with other modules.
The ServiceRegistrationBase
object may be used to update the properties of the service or to unregister the service.
Definition at line 56 of file usServiceRegistrationBase.h.
us::ServiceRegistrationBase::ServiceRegistrationBase | ( | const ServiceRegistrationBase & | reg | ) |
Definition at line 41 of file usServiceRegistrationBase.cpp.
us::ServiceRegistrationBase::~ServiceRegistrationBase | ( | ) |
Definition at line 78 of file usServiceRegistrationBase.cpp.
ServiceReferenceBase us::ServiceRegistrationBase::GetReference | ( | const std::string & | interfaceId = std::string() | ) | const |
Returns a ServiceReference
object for a service being registered.
The ServiceReference
object may be shared with other modules.
std::logic_error | If this ServiceRegistrationBase object has already been unregistered or if it is invalid. |
ServiceReference
object. Definition at line 84 of file usServiceRegistrationBase.cpp.
us::ServiceRegistrationBase::operator bool_type | ( | ) | const |
A boolean conversion operator converting this ServiceRegistrationBase object to true
if it is valid and to false
otherwise. A SeriveRegistration object is invalid if it was default-constructed or was invalidated by assigning 0 to it.
true
if this ServiceRegistrationBase object is valid, false
otherwise. Definition at line 60 of file usServiceRegistrationBase.cpp.
bool us::ServiceRegistrationBase::operator< | ( | const ServiceRegistrationBase & | o | ) | const |
Compare two ServiceRegistrationBase objects.
If both ServiceRegistrationBase objects are valid, the comparison is done using the underlying ServiceReference object. Otherwise, this ServiceRegistrationBase object is less than the other object if and only if this object is invalid and the other object is valid.
o | The ServiceRegistrationBase object to compare with. |
true
if this ServiceRegistrationBase object is less than the other object. Definition at line 247 of file usServiceRegistrationBase.cpp.
ServiceRegistrationBase & us::ServiceRegistrationBase::operator= | ( | int | null | ) |
Releases any resources held or locked by this ServiceRegistrationBase
and renders it invalid.
Definition at line 65 of file usServiceRegistrationBase.cpp.
ServiceRegistrationBase & us::ServiceRegistrationBase::operator= | ( | const ServiceRegistrationBase & | registration | ) |
Definition at line 259 of file usServiceRegistrationBase.cpp.
bool us::ServiceRegistrationBase::operator== | ( | const ServiceRegistrationBase & | registration | ) | const |
Definition at line 254 of file usServiceRegistrationBase.cpp.
void us::ServiceRegistrationBase::SetProperties | ( | const ServiceProperties & | properties | ) |
Updates the properties associated with a service.
The ServiceConstants::OBJECTCLASS and ServiceConstants::SERVICE_ID keys cannot be modified by this method. These values are set by the framework when the service is registered in the environment.
The following steps are taken to modify service properties:
properties | The properties for this service. See ServiceProperties for a list of standard service property keys. Changes should not be made to this object after calling this method. To update the service's properties this method should be called again. |
std::logic_error | If this ServiceRegistrationBase object has already been unregistered or if it is invalid. |
std::invalid_argument | If properties contains case variants of the same key name. |
Definition at line 94 of file usServiceRegistrationBase.cpp.
References us::any_cast(), us::ServiceEvent::MODIFIED, us::ServiceEvent::MODIFIED_ENDMATCH, us::ServiceConstants::OBJECTCLASS(), us::ref_any_cast(), us::ServiceConstants::SERVICE_ID(), us::ServiceConstants::SERVICE_RANKING(), and us::Any::Type().
void us::ServiceRegistrationBase::Unregister | ( | ) |
Unregisters a service. Remove a ServiceRegistrationBase
object from the framework service registry. All ServiceRegistrationBase
objects associated with this ServiceRegistrationBase
object can no longer be used to interact with the service once unregistration is complete.
The following steps are taken to unregister a service:
ServiceRegistrationBase
objects for the service may no longer be used to get a service object for the service. ServiceFactory::UngetService
method is called to release the service object for the module. std::logic_error | If this ServiceRegistrationBase object has already been unregistered or if it is invalid. |
Definition at line 153 of file usServiceRegistrationBase.cpp.
References us::ServiceFactory::UngetService(), and us::ServiceEvent::UNREGISTERING.
Referenced by mitk::ToFImageGrabber::StopCamera(), MitkCoreActivator::Unload(), and QmitkFreeSurferParcellationHandler::~QmitkFreeSurferParcellationHandler().