13 #ifndef ML_RUNTIME_DICT_H
14 #define ML_RUNTIME_DICT_H
26 #include <unordered_map>
30 ML_UTILS_START_NAMESPACE
95 bool onlyFromDifferentDlls =
false);
105 std::unordered_map<std::string, const RuntimeType*> _dict;
108 ML_UTILS_END_NAMESPACE
This file declares the class RuntimeDict that manages a set of instances of class RuntimeTypes.
void * createInstanceFromName(const char *className) const
Returns a pointer to a newly created instance of the runtime type or NULL if such an instance cannot ...
std::vector< const RuntimeType * > getAllDerivedFrom(const RuntimeType *parentType, bool onlyFromDifferentDlls=false)
Returns a list of all runtime types derived from parentType.
void destroyRuntimeTypesOfDll(const char *dllName)
Deletes all RuntimeTypes from the runtime dictionary that belong to the DLL with name dllName.
std::vector< const RuntimeType * > getAllRuntimeTypesOfDll(const char *dllName)
Returns a list of all runtime types implemented by DLL with name dllName.
std::vector< const RuntimeType * > getAllTypes()
Returns all registered types.
bool insert(const RuntimeType *runtimeType)
Inserts an new type into the runtime dictionary.
RuntimeDict()
Creates a new dictionary.
const RuntimeType * get(const char *className) const
Returns the runtime type for a given className (or NULL if not element present).
void clear()
Clears all dictionary entries and stored runtime types.
bool remove(const char *className)
Removes the element for the given className className.
~RuntimeDict()
Destructor. Removes the dictionary and all stored runtime types.
RuntimeType contains type and inheritance information of a class and a static dictionary with informa...