Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
#include <berryIAdapterFactory.h>
Public Member Functions | |
virtual | ~IAdapterFactory () |
virtual Object * | GetAdapter (IAdaptable *adaptableObject, const std::string &adapterType)=0 |
virtual void | GetAdapterList (std::vector< const std::type_info & > &adapters)=0 |
An adapter factory defines behavioral extensions for one or more classes that implements the IAdaptable
interface. Adapter factories are registered with an adapter manager.
This interface can be used without OSGi running.
Clients may implement this interface.
Definition at line 36 of file berryIAdapterFactory.h.
|
inlinevirtual |
Definition at line 38 of file berryIAdapterFactory.h.
|
pure virtual |
Returns an object which can be cast to the given adapter type and which is associated with the given adaptable object. Returns 0
if no such object can be found.
A typical implementation would look like this:
void* GetAdapter(void* adaptableObject, const std::type_info& adaptableType, const std::string& adapterType) { if (Image* img = CastHelper<Image>(adaptableObject, adaptableType)) { if (adapterType == "berry::IResource") { return new IResource(img->GetPath()); } } return 0; }
adaptableObject | the adaptable object being queried (usually an instance of IAdaptable ) |
adapterType | the type of adapter to look up |
0
if this adapter factory does not have an adapter of the given type for the given object
|
pure virtual |
Returns the collection of adapter types handled by this factory.
This method is generally used by an adapter manager to discover which adapter types are supported, in advance of dispatching any actual getAdapter
requests.
[out] | adapters | the collection of adapter types |