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 Member Functions | List of all members
ctkServiceTrackerCustomizer< T > Struct Template Referenceabstract

#include <Libs/PluginFramework/ctkServiceTrackerCustomizer.h>

Inheritance diagram for ctkServiceTrackerCustomizer< T >:
Inheritance graph
[legend]

Public Member Functions

virtual T addingService (const ctkServiceReference &reference)=0
 
virtual void modifiedService (const ctkServiceReference &reference, T service)=0
 
virtual void removedService (const ctkServiceReference &reference, T service)=0
 
virtual ~ctkServiceTrackerCustomizer ()
 

Detailed Description

template<class T = QObject*>
struct ctkServiceTrackerCustomizer< T >

The ctkServiceTrackerCustomizer interface allows a ctkServiceTracker to customize the service objects that are tracked. A ctkServiceTrackerCustomizer is called when a service is being added to a ctkServiceTracker. The ctkServiceTrackerCustomizer can then return an object for the tracked service. A ctkServiceTrackerCustomizer is also called when a tracked service is modified or has been removed from a ctkServiceTracker.

The methods in this interface may be called as the result of a ctkServiceEvent being received by a ctkServiceTracker. Since ctkServiceEvents are synchronously delivered by the Framework, it is highly recommended that implementations of these methods do not register (ctkPluginContext::registerService), modify ( ctkServiceRegistration::setProperties) or unregister ( ctkServiceRegistration::unregister) a service while being synchronized on any object.

The ctkServiceTracker class is thread-safe. It does not call a ctkServiceTrackerCustomizer while holding any locks. ctkServiceTrackerCustomizer implementations must also be thread-safe.

Template Parameters
TThe type of the tracked object.
Remarks
This class is thread safe.

Definition at line 61 of file ctkServiceTrackerCustomizer.h.

Constructor & Destructor Documentation

◆ ~ctkServiceTrackerCustomizer()

template<class T = QObject*>
virtual ctkServiceTrackerCustomizer< T >::~ctkServiceTrackerCustomizer ( )
inlinevirtual

Definition at line 63 of file ctkServiceTrackerCustomizer.h.

Member Function Documentation

◆ addingService()

template<class T = QObject*>
virtual T ctkServiceTrackerCustomizer< T >::addingService ( const ctkServiceReference reference)
pure virtual

A service is being added to the ctkServiceTracker.

This method is called before a service which matched the search parameters of the ctkServiceTracker is added to the ctkServiceTracker. This method should return the service object to be tracked for the specified ctkServiceReference. The returned service object is stored in the ctkServiceTracker and is available from the getService and getServices methods.

Parameters
referenceThe reference to the service being added to the ctkServiceTracker.
Returns
The service object to be tracked for the specified referenced service or 0 if the specified referenced service should not be tracked.

Implemented in ctkServiceTracker< S, T >.

◆ modifiedService()

template<class T = QObject*>
virtual void ctkServiceTrackerCustomizer< T >::modifiedService ( const ctkServiceReference reference,
service 
)
pure virtual

A service tracked by the ctkServiceTracker has been modified.

This method is called when a service being tracked by the ctkServiceTracker has had it properties modified.

Parameters
referenceThe reference to the service that has been modified.
serviceThe service object for the specified referenced service.

◆ removedService()

template<class T = QObject*>
virtual void ctkServiceTrackerCustomizer< T >::removedService ( const ctkServiceReference reference,
service 
)
pure virtual

A service tracked by the ctkServiceTracker has been removed.

This method is called after a service is no longer being tracked by the ctkServiceTracker.

Parameters
referenceThe reference to the service that has been removed.
serviceThe service object for the specified referenced service.

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