Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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

◆ 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

Member Function Documentation

◆ ApplyAdd()

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

◆ ApplyRemove()

virtual 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.

◆ CreateExtensionPointFilter() [1/2]

static 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

◆ CreateExtensionPointFilter() [2/2]

static 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

◆ CreateNamespaceFilter()

static 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

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ UnregisterObject() [1/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.

◆ UnregisterObject() [2/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.


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