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
ctkPluginTrackerCustomizer< T > Struct Template Referenceabstract

#include <Libs/PluginFramework/ctkPluginTrackerCustomizer.h>

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

Public Member Functions

virtual T addingPlugin (QSharedPointer< ctkPlugin > plugin, const ctkPluginEvent &event)=0
 
virtual void modifiedPlugin (QSharedPointer< ctkPlugin > plugin, const ctkPluginEvent &event, T object)=0
 
virtual void removedPlugin (QSharedPointer< ctkPlugin > plugin, const ctkPluginEvent &event, T object)=0
 
virtual ~ctkPluginTrackerCustomizer ()
 

Detailed Description

template<class T>
struct ctkPluginTrackerCustomizer< T >

The ctkPluginTrackerCustomizer interface allows a ctkPluginTracker to customize the ctkPlugins that are tracked. A ctkPluginTrackerCustomizer is called when a plugin is being added to a ctkPluginTracker. The ctkPluginTrackerCustomizer can then return an object for the tracked plugin. A ctkPluginTrackerCustomizer is also called when a tracked plugin is modified or has been removed from a ctkPluginTracker.

The methods in this interface may be called as the result of a ctkPluginEvent being received by a ctkPluginTracker. Since ctkPluginEvents are received synchronously by the ctkPluginTracker, it is highly recommended that implementations of these methods do not alter plugin states while being synchronized on any object.

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

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

Definition at line 63 of file ctkPluginTrackerCustomizer.h.

Constructor & Destructor Documentation

◆ ~ctkPluginTrackerCustomizer()

template<class T >
virtual ctkPluginTrackerCustomizer< T >::~ctkPluginTrackerCustomizer ( )
inlinevirtual

Definition at line 65 of file ctkPluginTrackerCustomizer.h.

Member Function Documentation

◆ addingPlugin()

template<class T >
virtual T ctkPluginTrackerCustomizer< T >::addingPlugin ( QSharedPointer< ctkPlugin plugin,
const ctkPluginEvent event 
)
pure virtual

A plugin is being added to the ctkPluginTracker.

This method is called before a plugin which matched the search parameters of the ctkPluginTracker is added to the ctkPluginTracker. This method should return the object to be tracked for the specified ctkPlugin. The returned object is stored in the ctkPluginTracker and is available from the ctkPluginTracker::getObject(ctkPlugin*) method.

Parameters
pluginThe ctkPlugin being added to the ctkPluginTracker.
eventThe plugin event which caused this customizer method to be called or an invalid event (ctkPluginEvent::isNull() returns true) if there is no plugin event associated with the call to this method.
Returns
The object to be tracked for the specified ctkPlugin object or null if the specified ctkPlugin object should not be tracked.

Implemented in ctkPluginTracker< T >.

◆ modifiedPlugin()

template<class T >
virtual void ctkPluginTrackerCustomizer< T >::modifiedPlugin ( QSharedPointer< ctkPlugin plugin,
const ctkPluginEvent event,
object 
)
pure virtual

A plugin tracked by the ctkPluginTracker has been modified.

This method is called when a plugin being tracked by the ctkPluginTracker has had its state modified.

Parameters
pluginThe ctkPlugin whose state has been modified.
eventThe plugin event which caused this customizer method to be called or an invalid event (ctkPluginEvent::isNull() returns true) if there is no plugin event associated with the call to this method.
objectThe tracked object for the specified plugin.

◆ removedPlugin()

template<class T >
virtual void ctkPluginTrackerCustomizer< T >::removedPlugin ( QSharedPointer< ctkPlugin plugin,
const ctkPluginEvent event,
object 
)
pure virtual

A plugin tracked by the ctkPluginTracker has been removed.

This method is called after a plugin is no longer being tracked by the ctkPluginTracker.

Parameters
pluginThe ctkPlugin that has been removed.
eventThe plugin event which caused this customizer method to be called or an invalid event (ctkPluginEvent::isNull() returns true) if there is no plugin event associated with the call to this method.
objectThe tracked object for the specified plugin.

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