Medical Imaging Interaction Toolkit  2023.04.99-859410e3
Medical Imaging Interaction Toolkit
berry::IAdaptable Struct Referenceabstract

#include <berryIAdaptable.h>

Inheritance diagram for berry::IAdaptable:

Public Member Functions

virtual ObjectGetAdapter (const QString &adapterType) const =0
template<class A >
A * GetAdapter ()
virtual ~IAdaptable ()

Detailed Description

An interface for an adaptable object.

Adaptable objects can be dynamically extended to provide different interfaces (or "adapters"). Adapters are created by adapter factories, which are in turn managed by type by adapter managers.

For example,

    IAdaptable a = [some adaptable];
    IFoo x = (IFoo)a.getAdapter(IFoo.class);
    if (x != null)
        [do IFoo things with x]


This interface can be used without OSGi running.

Clients may implement this interface, or obtain a default implementation of this interface by subclassing PlatformObject.

See also

Definition at line 50 of file berryIAdaptable.h.

Constructor & Destructor Documentation

◆ ~IAdaptable()

virtual berry::IAdaptable::~IAdaptable ( )

Member Function Documentation

◆ GetAdapter() [1/2]

template<class A >
A* berry::IAdaptable::GetAdapter ( )

Definition at line 68 of file berryIAdaptable.h.

References BERRY_WARN, and berry::Reflection::DemangleName().

◆ GetAdapter() [2/2]

virtual Object* berry::IAdaptable::GetAdapter ( const QString &  adapterType) const
pure virtual

Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

adapterTypethe adapter class to look up
a object castable to the given class, or null if this object does not have an adapter for the given class

Implemented in mitk::DataStorageEditorInput, berry::FileEditorInput, berry::Saveable, and berry::PlatformObject.

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