MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlRuntime.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_RUNTIME_H
14#define ML_RUNTIME_H
15
24
25// ML-includes
26#include "mlUtilsSystem.h"
27#include "mlRuntimeType.h"
28
29#include <vector>
30
32
34class RuntimeDict;
36
37//-------------------------------------------------------------------------
48//-------------------------------------------------------------------------
50{
51
52public:
54 static void init();
55
57 static void destroy();
58
62 static const RuntimeType* fromName(const char* name);
63
81 static const RuntimeType* initType(const RuntimeType* classType, const char* parentName, const char* classPrefix,
82 const char* className, RuntimeType::RuntimeTypeCreateCB* createCB,
83 const char* classNameReplacement = nullptr);
84
87 static void destroyType(const char* name);
88
90 static const RuntimeType* badType();
91
94 static void setRecentlyLoadedDllName(const char* name);
95
98 static const char* getRecentlyLoadedDllName();
99
103 static void destroyRuntimeTypesOfDll(const char* dllName);
104
110 static std::vector<const RuntimeType*> getAllDerivedFrom(const RuntimeType* parentType,
111 bool onlyFromDifferentDlls = false);
112
114 static std::vector<const RuntimeType*> getAllTypes();
115
122 [[nodiscard]]
123 static const char* _getCheckedTypeIdName(const RuntimeType* classType, const char* className);
124
125protected:
134 static const RuntimeType* createType(const char* parentName, const char* name,
135 RuntimeType::RuntimeTypeCreateCB* callback);
136};
137
138
140
141#endif // __mlRuntime_H
RuntimeType contains type and inheritance information of a class and a static dictionary with informa...
This class contains the runtime system of the ML.
Definition mlRuntime.h:50
static void init()
Initializes the runtime type dictionary.
static std::vector< const RuntimeType * > getAllDerivedFrom(const RuntimeType *parentType, bool onlyFromDifferentDlls=false)
Returns a list of all runtime types derived from parentType.
static const char * getRecentlyLoadedDllName()
Returns the name of the most recently loaded DLL.
static std::vector< const RuntimeType * > getAllTypes()
Returns all types that are registered in the typesystem.
static void destroyRuntimeTypesOfDll(const char *dllName)
Deletes all RuntimeTypes from the runtime dictionary that belong to the the DLL with name dllName.
static void destroy()
Destroys the runtime type dictionary.
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 * _getCheckedTypeIdName(const RuntimeType *classType, const char *className)
Helper function for the runtime interface in Runtime-derived classes to perform some check without ha...
static const RuntimeType * fromName(const char *name)
Returns the (runtime) type of a class given by its name using the runtime type dictionary.
static void destroyType(const char *name)
Destroys a dictionary entry with a given name.
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 a double initialization call.
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,...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_UTILS_EXPORT
Definition mlUtilities.h:18