MeVisLab Toolbox Reference
|
This class contains the runtime system of the ML. More...
#include <mlRuntime.h>
Static Public Member Functions | |
static void | init () |
Initializes runtime type dictionary. | |
static void | destroy () |
Destroys runtime type dictionary. | |
static const RuntimeType * | fromName (const char *name) |
Returns the (runtime)type of a class given by its name using the runtime type dictionary. | |
static const RuntimeType * | initType (const RuntimeType *classType, const char *parentName, const char *classPrefix, const char *className, RuntimeType::RuntimeTypeCreateCB *createCB, const char *classNameReplacement=nullptr) |
Initializes a new type and tests for double init call. | |
static void | destroyType (const char *name) |
Destroys a dictionary entry with a given name . | |
static const RuntimeType * | badType () |
Returns a global badtype instance of RuntimeType . | |
static void | setRecentlyLoadedDllName (const char *name) |
Sets the name of the most recently loaded dll. | |
static const char * | getRecentlyLoadedDllName () |
Returns the name of the most recently loaded dll. | |
static void | destroyRuntimeTypesOfDll (const char *dllName) |
Deletes all RuntimeTypes from the runtime dictionary which belong to the the dll with name dllName . | |
static std::vector< const RuntimeType * > | getAllDerivedFrom (const RuntimeType *parentType, bool onlyFromDifferentDlls=false) |
Returns a list of all runtime types derived from parentType . | |
static std::vector< const RuntimeType * > | getAllTypes () |
Returns all types that are registered in the typesystem. | |
static const char * | _getCheckedTypeIdName (const RuntimeType *classType, const char *className) |
Helper function for the runtime interface in Runtime-derived classes to perform some check without having to implement the check code again in classes. | |
Static Protected Member Functions | |
static const RuntimeType * | createType (const char *parentName, const char *name, RuntimeType::RuntimeTypeCreateCB *callback) |
Creates a new (runtime)type, representing a class with parent class name parentName , typename name and a callback function callback to create an instance of this class. | |
This class contains the runtime system of the ML.
It manages a dictionary of runtime types, it can create and remove runtime types. This class contains only static components and must be initialized with init() and destroyed with destroy().
Thread-safety: This class is not thread-safe and should only be used from the main thread. The same applies to the initClass() method of classes derived from the ml::Base class.
Definition at line 49 of file mlRuntime.h.
|
static |
Helper function for the runtime interface in Runtime-derived classes to perform some check without having to implement the check code again in classes.
It returns the null terminated type name of the runtime type given by classType or the string "<Name of Uninitialized Type>" if the type is still NULL/uninitialized. That case will also cause an ML error message with code ML_TYPE_NOT_REGISTERED. Not for public use!
|
static |
Returns a global badtype instance of RuntimeType
.
|
staticprotected |
Creates a new (runtime)type, representing a class with parent class name parentName
, typename name
and a callback function callback
to create an instance of this class.
The callback may be NULL for abstract types. The type is inserted into the runtime dictionary to be accessible later. When inserting, it is tested whether a same named type exists and if it existed, this function returns NULL because same named types are not supported by the runtime type system. Also an error is send with ML_PRINT_ERROR(). Notifies MLNotify on valid insertion. See mlMLNotify.h for more infos.
Deletes all RuntimeTypes from the runtime dictionary which belong to the the dll with name dllName
.
This call is ignored if no types are found or a NULL name is passed as dllName
.
Destroys a dictionary entry with a given name
.
Nothing is done if type is not found. Notifies notify
. See mlMLNotify.h
for more infos.
|
static |
Returns the (runtime)type of a class given by its name
using the runtime type dictionary.
NULL is returned if no runtime type with name
is found.
|
static |
Returns a list of all runtime types derived from parentType
.
The returned list will be empty if no type is found or if parentType
is NULL. parentType
itself will not be part of the result. If onlyFromDifferentDlls
is false
(the default), all derived types are added; if it is true
, only types with differing dllNames are added. If dllNames
strings are not set, empty or different then the types are considered from different dlls.
|
static |
Returns all types that are registered in the typesystem.
Returns the name of the most recently loaded dll.
Returns NULL if no dll has been loaded.
|
static |
Initializes a new type and tests for double init call.
classType
is the still uninitialized pointer to the badType() runtime type instance. parentName
is the string name of the parent class type. classPrefix
is the string name of a prefix which will be added as prefix before className
. className
is the string name of the class type itself and createCB
is the callback to create an instance of the type. For abstract types it may be NULL. classNameReplacement
is an alternative name which can be specified to register the class className under another name, for example to avoid the collision with another initialized version of className; must be NULL if replacement is not desired. All strings must be null-terminated or - if permitted - NULL. Return value is the initialized runtime type on success; classType
if type is already initialized, badType()
if same type name already exists.
Sets the name
of the most recently loaded dll.
Clears name if NULL is passed. Only to be called from the ML!