Medical Imaging Interaction Toolkit  2016.11.0
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
IAdapterFactory
IAdapterManager
PlatformObject

Definition at line 54 of file berryIAdaptable.h.

Constructor & Destructor Documentation

berry::IAdaptable::~IAdaptable ( )
virtual

Definition at line 21 of file berryIAdaptable.cpp.

Member Function Documentation

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.

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

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

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

Definition at line 72 of file berryIAdaptable.h.

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


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