CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Member Functions | List of all members
ctkServiceEvent Class Reference

#include <Libs/PluginFramework/ctkServiceEvent.h>

Public Types

enum  Type { REGISTERED = 0x00000001 , MODIFIED = 0x00000002 , UNREGISTERING = 0x00000004 , MODIFIED_ENDMATCH = 0x00000008 }
 

Public Member Functions

 ctkServiceEvent ()
 
 ctkServiceEvent (const ctkServiceEvent &other)
 
 ctkServiceEvent (Type type, const ctkServiceReference &reference)
 
ctkServiceReference getServiceReference () const
 
Type getType () const
 
bool isNull () const
 
ctkServiceEventoperator= (const ctkServiceEvent &other)
 
 ~ctkServiceEvent ()
 

Detailed Description

An event from the Plugin Framework describing a service lifecycle change.

ctkServiceEvent objects are delivered to slots connected via ctkPluginContext::connectServiceListener() 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 51 of file ctkServiceEvent.h.

Member Enumeration Documentation

◆ Type

Enumerator
REGISTERED 

This service has been registered.

This event is synchronously delivered after the service has been registered with the Framework.

See also
ctkPluginContext::registerService()
MODIFIED 

The properties of a registered service have been modified.

This event is synchronously delivered after the service properties have been modified.

See also
ctkServiceRegistration::setProperties
UNREGISTERING 

This service is in the process of being unregistered.

This event is synchronously delivered before the service has completed unregistering.

If a plugin is using a service that is UNREGISTERING, the plugin should release its use of the service when it receives this event. If the plugin does not release its use of the service when it receives this event, the Framework will automatically release the plugin's use of the service while completing the service unregistration operation.

See also
ctkServiceRegistration::unregister
ctkPluginContext::ungetService
MODIFIED_ENDMATCH 

The properties of a registered service have been modified and the new properties no longer match the listener's filter.

This event is synchronously delivered after the service properties have been modified. This event is only delivered to slots which were added with a non-null filter where the filter matched the service properties prior to the modification but the filter does not match the modified service properties.

See also
ctkServiceRegistration::setProperties

Definition at line 58 of file ctkServiceEvent.h.

Constructor & Destructor Documentation

◆ ctkServiceEvent() [1/3]

ctkServiceEvent::ctkServiceEvent ( )

Default constructor for use with the Qt meta object system.

◆ ~ctkServiceEvent()

ctkServiceEvent::~ctkServiceEvent ( )

◆ ctkServiceEvent() [2/3]

ctkServiceEvent::ctkServiceEvent ( Type  type,
const ctkServiceReference reference 
)

Creates a new service event object.

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

◆ ctkServiceEvent() [3/3]

ctkServiceEvent::ctkServiceEvent ( const ctkServiceEvent other)

Member Function Documentation

◆ getServiceReference()

ctkServiceReference ctkServiceEvent::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.

◆ getType()

Type ctkServiceEvent::getType ( ) const

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

Returns
Type of service lifecycle change.

◆ isNull()

bool ctkServiceEvent::isNull ( ) const

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

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

◆ operator=()

ctkServiceEvent& ctkServiceEvent::operator= ( const ctkServiceEvent other)

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