![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/PluginFramework/ctkServiceTrackerCustomizer.h>
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 () |
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 ctkServiceEvent
s 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.
T | The type of the tracked object. |
Definition at line 61 of file ctkServiceTrackerCustomizer.h.
|
inlinevirtual |
Definition at line 63 of file ctkServiceTrackerCustomizer.h.
|
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.
reference | The reference to the service being added to the ctkServiceTracker . |
0
if the specified referenced service should not be tracked. Implemented in ctkServiceTracker< S, T >.
|
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.
reference | The reference to the service that has been modified. |
service | The service object for the specified referenced 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
.
reference | The reference to the service that has been removed. |
service | The service object for the specified referenced service. |