ML Reference
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 
31 ML_UTILS_START_NAMESPACE
32 
34  class RuntimeDict;
36 
37  //-------------------------------------------------------------------------
48  //-------------------------------------------------------------------------
50 
51  public:
53  static void init();
54 
56  static void destroy();
57 
61  static const RuntimeType* fromName(const char* name);
62 
80  static const RuntimeType* initType(const RuntimeType *classType,
81  const char *parentName,
82  const char *classPrefix,
83  const char *className,
84  RuntimeType::RuntimeTypeCreateCB *createCB,
85  const char *classNameReplacement=nullptr);
86 
89  static void destroyType(const char* name);
90 
92  static const RuntimeType* badType();
93 
96  static void setRecentlyLoadedDllName(const char* name);
97 
100  static const char* getRecentlyLoadedDllName();
101 
105  static void destroyRuntimeTypesOfDll(const char* dllName);
106 
112  static std::vector<const RuntimeType*> getAllDerivedFrom(const RuntimeType *parentType,
113  bool onlyFromDifferentDlls=false);
114 
116  static std::vector<const RuntimeType*> getAllTypes();
117 
124  [[nodiscard]]
125  static const char *_getCheckedTypeIdName(const RuntimeType* classType,
126  const char *className);
127 
128  protected:
137  static const RuntimeType* createType(const char *parentName,
138  const char *name,
139  RuntimeType::RuntimeTypeCreateCB* callback);
140  };
141 
142 
143 ML_UTILS_END_NAMESPACE
144 
145 #endif // __mlRuntime_H
RuntimeType contains type and inheritance information of a class and a static dictionary with informa...
Definition: mlRuntimeType.h:53
This class contains the runtime system of the ML.
Definition: mlRuntime.h:49
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,...
static void init()
Initializes 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 a double initialization call.
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 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 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 * badType()
Returns a global badtype instance of RuntimeType.
static const char * getRecentlyLoadedDllName()
Returns the name of the most recently loaded DLL.
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 void destroyType(const char *name)
Destroys a dictionary entry with a given name.
#define ML_UTILS_EXPORT
Definition: mlUtilities.h:18