Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::ExtensionTracker Class Reference

#include <berryExtensionTracker.h>

Inheritance diagram for berry::ExtensionTracker:
Collaboration diagram for berry::ExtensionTracker:

Public Member Functions

 ExtensionTracker ()
 
 ~ExtensionTracker ()
 
 ExtensionTracker (IExtensionRegistry *theRegistry)
 
void RegisterHandler (IExtensionChangeHandler *handler, const IExtensionPointFilter &filter) override
 
void RegisterHandler (IExtensionChangeHandler *handler, const QString &extensionPointId) override
 
void UnregisterHandler (IExtensionChangeHandler *handler) override
 
void RegisterObject (const SmartPointer< IExtension > &element, const SmartPointer< Object > &object, ReferenceType referenceType) override
 
QList< SmartPointer< Object > > GetObjects (const SmartPointer< IExtension > &element) const override
 
void Close () override
 
void UnregisterObject (const SmartPointer< IExtension > &extension, const SmartPointer< Object > &object) override
 
QList< SmartPointer< Object > > UnregisterObject (const SmartPointer< IExtension > &extension) override
 
- Public Member Functions inherited from berry::IExtensionTracker
virtual ~IExtensionTracker ()
 

Static Public Member Functions

static IExtensionPointFilter CreateExtensionPointFilter (const SmartPointer< IExtensionPoint > &xpt)
 
static IExtensionPointFilter CreateExtensionPointFilter (const QList< SmartPointer< IExtensionPoint > > &xpts)
 
static IExtensionPointFilter CreateNamespaceFilter (const QString &id)
 

Protected Member Functions

virtual void ApplyAdd (IExtensionChangeHandler *handler, const SmartPointer< IExtension > &extension)
 
virtual void ApplyRemove (IExtensionChangeHandler *handler, const SmartPointer< IExtension > &removedExtension, const QList< SmartPointer< Object > > &removedObjects)
 

Additional Inherited Members

- Public Types inherited from berry::IExtensionTracker
enum  ReferenceType { REF_STRONG, REF_WEAK }
 

Detailed Description

Implementation of the IExtensionTracker.

See also
IExtensionTracker

Definition at line 34 of file berryExtensionTracker.h.

Constructor & Destructor Documentation

berry::ExtensionTracker::ExtensionTracker ( )
berry::ExtensionTracker::~ExtensionTracker ( )

Definition at line 120 of file berryExtensionTracker.cpp.

berry::ExtensionTracker::ExtensionTracker ( IExtensionRegistry theRegistry)

Construct a new instance of the extension tracker using the given registry containing tracked extensions and extension points.

Parameters
theRegistrythe extension registry to track

Definition at line 124 of file berryExtensionTracker.cpp.

Member Function Documentation

void berry::ExtensionTracker::ApplyAdd ( IExtensionChangeHandler handler,
const SmartPointer< IExtension > &  extension 
)
protectedvirtual
void berry::ExtensionTracker::ApplyRemove ( IExtensionChangeHandler handler,
const SmartPointer< IExtension > &  removedExtension,
const QList< SmartPointer< Object > > &  removedObjects 
)
protectedvirtual
void berry::ExtensionTracker::Close ( )
overridevirtual

Close the tracker. All registered objects are freed and all handlers are being automatically removed.

Implements berry::IExtensionTracker.

Definition at line 204 of file berryExtensionTracker.cpp.

IExtensionPointFilter berry::ExtensionTracker::CreateExtensionPointFilter ( const SmartPointer< IExtensionPoint > &  xpt)
static

Return an instance of filter matching all changes for the given extension point.

Parameters
xptthe extension point
Returns
a filter

Definition at line 263 of file berryExtensionTracker.cpp.

IExtensionPointFilter berry::ExtensionTracker::CreateExtensionPointFilter ( const QList< SmartPointer< IExtensionPoint > > &  xpts)
static

Return an instance of filter matching all changes for the given extension points.

Parameters
xptsthe extension points used to filter
Returns
a filter

Definition at line 281 of file berryExtensionTracker.cpp.

IExtensionPointFilter berry::ExtensionTracker::CreateNamespaceFilter ( const QString &  id)
static

Return an instance of filter matching all changes from a given plugin.

Parameters
idthe plugin id
Returns
a filter

Definition at line 306 of file berryExtensionTracker.cpp.

References berry::IExtensionPoint::GetNamespaceIdentifier().

QList< SmartPointer< Object > > berry::ExtensionTracker::GetObjects ( const SmartPointer< IExtension > &  extension) const
overridevirtual

Return all the objects that have been associated with the given extension. All objects registered strongly will be return unless they have been unregistered. The objects registered softly or weakly may not be returned if they have been garbage collected. Return an empty array if no associations exist.

Parameters
extensionthe extension for which the object must be returned
Returns
the array of associated objects

Implements berry::IExtensionTracker.

Definition at line 181 of file berryExtensionTracker.cpp.

References berry::WeakPointer< TObjectType >::Expired(), and berry::WeakPointer< TObjectType >::Lock().

void berry::ExtensionTracker::RegisterHandler ( IExtensionChangeHandler handler,
const IExtensionPointFilter filter 
)
overridevirtual

Register an extension change handler with this tracker using the given filter.

Parameters
handlerthe handler to be registered
filterthe filter to use to choose interesting changes

Implements berry::IExtensionTracker.

Definition at line 141 of file berryExtensionTracker.cpp.

Referenced by RegisterHandler().

void berry::ExtensionTracker::RegisterHandler ( IExtensionChangeHandler handler,
const QString &  extensionPointId 
)
overridevirtual

Register an extension change handler with this tracker for the given extension point id.

Parameters
handlerthe handler to be registered
extensionPointIdthe extension point id to track

Implements berry::IExtensionTracker.

Definition at line 149 of file berryExtensionTracker.cpp.

References RegisterHandler().

void berry::ExtensionTracker::RegisterObject ( const SmartPointer< IExtension > &  extension,
const SmartPointer< Object > &  object,
ReferenceType  referenceType 
)
overridevirtual

Create an association between the given extension and the given object. The referenceType indicates how strongly the object is being kept in memory. There are 2 possible values: REF_STRONG and REF_WEAK.

Parameters
extensionthe extension
objectthe object to associate with the extension
referenceTypeone of REF_STRONG, REF_WEAK

Implements berry::IExtensionTracker.

Definition at line 164 of file berryExtensionTracker.cpp.

References berry::SmartPointer< TObjectType >::IsNull(), berry::IExtensionTracker::REF_STRONG, and berry::IExtensionTracker::REF_WEAK.

void berry::ExtensionTracker::UnregisterHandler ( IExtensionChangeHandler handler)
overridevirtual

Unregister the given extension change handler previously registered with this tracker.

Parameters
handlerthe handler to be unregistered

Implements berry::IExtensionTracker.

Definition at line 155 of file berryExtensionTracker.cpp.

void berry::ExtensionTracker::UnregisterObject ( const SmartPointer< IExtension > &  extension,
const SmartPointer< Object > &  object 
)
overridevirtual

Remove an association between the given extension and the given object.

Parameters
extensionthe extension under which the object has been registered
objectthe object to unregister

Implements berry::IExtensionTracker.

Definition at line 220 of file berryExtensionTracker.cpp.

QList< SmartPointer< Object > > berry::ExtensionTracker::UnregisterObject ( const SmartPointer< IExtension > &  extension)
overridevirtual

Remove all the objects associated with the given extension. Return the removed objects.

Parameters
extensionthe extension for which the objects are removed
Returns
the objects that were associated with the extension

Implements berry::IExtensionTracker.

Definition at line 237 of file berryExtensionTracker.cpp.

References berry::WeakPointer< TObjectType >::Expired(), and berry::WeakPointer< TObjectType >::Lock().


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