MeVisLab Toolbox Reference
|
RuntimeType contains type and inheritance information of a class and a static dictionary with information on all created instances of RuntimeType. More...
#include <mlRuntimeType.h>
Public Types | |
typedef void * | RuntimeTypeCreateCB() |
A type of a callback function to create an instance of a class handled by the Runtime class. More... | |
Public Member Functions | |
Specific information about the runtime type. | |
ML_UTILS_EXPORT | RuntimeType (const RuntimeType *parent=nullptr, const char *className=nullptr, RuntimeTypeCreateCB *callback=nullptr, const char *dllName=nullptr) |
Constructor. More... | |
ML_UTILS_EXPORT | ~RuntimeType () |
Destructor. Cleans up all elements. More... | |
ML_UTILS_EXPORT bool | isDerivedFrom (const RuntimeType *runtimeType) const |
Returns true if this (runtime) type is derived from the argument (runtime) type runtimeType . More... | |
const char * | getName () const |
Returns the NULL-terminated string name of the class. Returns 'BadType' on error. More... | |
const char * | getDllName () const |
Returns the NULL-terminated string name of the source DLL or "" if it is unknown. More... | |
const RuntimeType * | getParent () const |
Returns the parent (runtime) type of the type, i.e., the type it is derived from or NULL if not derived from any other type. More... | |
bool | canCreateInstance () const |
Returns true if this (runtime) type knows how to create an instance of the class. More... | |
void * | createInstance () const |
Creates and returns an instance of the of the class or NULL if such an instance is unavailable. More... | |
RuntimeTypeCreateCB * | getCallback () const |
Returns the callback used to create an instance of the object or NULL on abstract classes. More... | |
MLint | getId () const |
Returns the ID that describes where the type was registered in the Runtime Type System. More... | |
RuntimeType contains type and inheritance information of a class and a static dictionary with information on all created instances of RuntimeType.
RuntimeType thus represents the TYPE on an associated class.
Thread-safety: This class is reentrant.
An instance of RuntimeType is associated with a class (e.g., an image processing module like AddModule) and contains
This class has (static) access to a static dictionary, in which entries for all created instances of RuntimeType can be found.
Note that this class does not have a copy constructor or an assignment operator since a RuntimeType needs to be unique in the dictionary. Create a new type with other name if needed.
Definition at line 53 of file mlRuntimeType.h.
typedef void* ml::RuntimeType::RuntimeTypeCreateCB() |
A type of a callback function to create an instance of a class handled by the Runtime class.
Definition at line 57 of file mlRuntimeType.h.
ML_UTILS_EXPORT ml::RuntimeType::RuntimeType | ( | const RuntimeType * | parent = nullptr , |
const char * | className = nullptr , |
||
RuntimeTypeCreateCB * | callback = nullptr , |
||
const char * | dllName = nullptr |
||
) |
Constructor.
Passes the string name of the class type className
and the name of DLL in dllName
. If no dllName
is passed, the name of the last most loaded DLL is used. If className
is passed as NULL, an invalid default bad type is constructed.
ML_UTILS_EXPORT ml::RuntimeType::~RuntimeType | ( | ) |
Destructor. Cleans up all elements.
|
inline |
Returns true
if this (runtime) type knows how to create an instance of the class.
Definition at line 94 of file mlRuntimeType.h.
Referenced by ml::CopyBase< BASE_DERIVED_CLASS >::checkObjectType(), and ml::ListTemplate< T >::clone().
|
inline |
Creates and returns an instance of the of the class or NULL if such an instance is unavailable.
Definition at line 98 of file mlRuntimeType.h.
Referenced by ml::ListTemplate< T >::clone().
|
inline |
Returns the callback used to create an instance of the object or NULL on abstract classes.
Definition at line 101 of file mlRuntimeType.h.
|
inline |
Returns the NULL-terminated string name of the source DLL or "" if it is unknown.
Definition at line 87 of file mlRuntimeType.h.
|
inline |
Returns the ID that describes where the type was registered in the Runtime Type System.
Definition at line 104 of file mlRuntimeType.h.
|
inline |
Returns the NULL-terminated string name of the class. Returns 'BadType' on error.
Definition at line 84 of file mlRuntimeType.h.
Referenced by ml::CopyBase< BASE_DERIVED_CLASS >::checkObjectType(), and ml::ListContainerTemplate< T >::ListContainerTemplate().
|
inline |
Returns the parent (runtime) type of the type, i.e., the type it is derived from or NULL if not derived from any other type.
Definition at line 91 of file mlRuntimeType.h.
ML_UTILS_EXPORT bool ml::RuntimeType::isDerivedFrom | ( | const RuntimeType * | runtimeType | ) | const |
Returns true
if this (runtime) type is derived from the argument (runtime) type runtimeType
.
Note that a type is always considered as derived from itself, i.e., a type A is derived from a type A. If a NULL pointer is passed, false
is returned.
Referenced by ml::CopyBase< BASE_DERIVED_CLASS >::checkObjectType().