Medical Imaging Interaction Toolkit  2018.4.99-08619e4f
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 () override
 
 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 30 of file berryExtensionTracker.h.

Constructor & Destructor Documentation

◆ ExtensionTracker() [1/2]

berry::ExtensionTracker::ExtensionTracker ( )

◆ ~ExtensionTracker()

berry::ExtensionTracker::~ExtensionTracker ( )
override

Definition at line 116 of file berryExtensionTracker.cpp.

◆ ExtensionTracker() [2/2]

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 120 of file berryExtensionTracker.cpp.

References BERRY_ERROR.

Member Function Documentation

◆ ApplyAdd()

void berry::ExtensionTracker::ApplyAdd ( IExtensionChangeHandler handler,
const SmartPointer< IExtension > &  extension 
)
protectedvirtual

◆ ApplyRemove()

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

◆ Close()

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 200 of file berryExtensionTracker.cpp.

◆ CreateExtensionPointFilter() [1/2]

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 259 of file berryExtensionTracker.cpp.

◆ CreateExtensionPointFilter() [2/2]

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 277 of file berryExtensionTracker.cpp.

◆ CreateNamespaceFilter()

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 302 of file berryExtensionTracker.cpp.

References berry::IExtensionPoint::GetNamespaceIdentifier().

◆ GetObjects()

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 177 of file berryExtensionTracker.cpp.

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

◆ RegisterHandler() [1/2]

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 137 of file berryExtensionTracker.cpp.

Referenced by RegisterHandler().

◆ RegisterHandler() [2/2]

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 145 of file berryExtensionTracker.cpp.

References RegisterHandler().

◆ RegisterObject()

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 160 of file berryExtensionTracker.cpp.

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

◆ UnregisterHandler()

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 151 of file berryExtensionTracker.cpp.

◆ UnregisterObject() [1/2]

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 216 of file berryExtensionTracker.cpp.

◆ UnregisterObject() [2/2]

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 233 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: