Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
us::ServiceEvent Class Reference

#include <usServiceEvent.h>

Public Types

enum  Type { REGISTERED, MODIFIED, UNREGISTERING, MODIFIED_ENDMATCH }
 

Public Member Functions

 ServiceEvent ()
 
 ~ServiceEvent ()
 
bool IsNull () const
 
 ServiceEvent (Type type, const ServiceReferenceBase &reference)
 
 ServiceEvent (const ServiceEvent &other)
 
ServiceEventoperator= (const ServiceEvent &other)
 
ServiceReferenceU GetServiceReference () const
 
template<class S >
ServiceReference< S > GetServiceReference (InterfaceType< S >) const
 
Type GetType () const
 

Detailed Description

An event from the Micro Services framework describing a service lifecycle change.

ServiceEvent objects are delivered to listeners connected via ModuleContext::AddServiceListener() when a change occurs in this service's lifecycle. A type code is used to identify the event type for future extendability.

Definition at line 60 of file usServiceEvent.h.

Constructor & Destructor Documentation

us::ServiceEvent::ServiceEvent ( )

Creates an invalid instance.

Definition at line 53 of file usServiceEvent.cpp.

us::ServiceEvent::~ServiceEvent ( )

Definition at line 59 of file usServiceEvent.cpp.

us::ServiceEvent::ServiceEvent ( Type  type,
const ServiceReferenceBase reference 
)

Creates a new service event object.

Parameters
typeThe event type.
referenceA ServiceReference object to the service that had a lifecycle change.

Definition at line 69 of file usServiceEvent.cpp.

us::ServiceEvent::ServiceEvent ( const ServiceEvent other)

Definition at line 75 of file usServiceEvent.cpp.

Member Function Documentation

ServiceReferenceU us::ServiceEvent::GetServiceReference ( ) const

Returns a reference to the service that had a change occur in its lifecycle.

This reference is the source of the event.

Returns
Reference to the service that had a lifecycle change.

Definition at line 87 of file usServiceEvent.cpp.

Referenced by QmitkServiceListWidget::OnServiceEvent().

template<class S >
ServiceReference<S> us::ServiceEvent::GetServiceReference ( InterfaceType< S >  ) const
inline

Definition at line 163 of file usServiceEvent.h.

ServiceEvent::Type us::ServiceEvent::GetType ( ) const

Returns the type of event. The event type values are:

Returns
Type of service lifecycle change.

Definition at line 92 of file usServiceEvent.cpp.

Referenced by mitk::USActivator::OnServiceEvent(), QmitkToolTrackingStatusWidget::OnServiceEvent(), and QmitkServiceListWidget::OnServiceEvent().

bool us::ServiceEvent::IsNull ( ) const

Can be used to check if this ServiceEvent instance is valid, or if it has been constructed using the default constructor.

Returns
true if this event object is valid, false otherwise.

Definition at line 64 of file usServiceEvent.cpp.

Referenced by us::operator<<().

ServiceEvent & us::ServiceEvent::operator= ( const ServiceEvent other)

Definition at line 81 of file usServiceEvent.cpp.


The documentation for this class was generated from the following files: