ML Reference
|
00001 // **InsertLicense** code 00002 //------------------------------------------------------------------------- 00010 00014 //------------------------------------------------------------------------- 00015 #ifndef __mlRuntimeDict_H 00016 #define __mlRuntimeDict_H 00017 00018 // ML-includes 00019 #ifndef __mlUtilsSystem_H 00020 #include "mlUtilsSystem.h" 00021 #endif 00022 00023 ML_UTILS_START_NAMESPACE 00024 00026 class RuntimeType; 00027 class RuntimeDictEntry; 00029 00030 //------------------------------------------------------------------------- 00038 //------------------------------------------------------------------------- 00039 class RuntimeDict { 00040 00041 public: 00042 00045 RuntimeDict(MLuint32 tableSize = 211); 00046 00048 ~RuntimeDict(); 00049 00054 void clear(bool applyFinalCheck=false); 00055 00060 RuntimeDictEntry* insert(const RuntimeType* runtimeType); 00061 00067 const RuntimeType* remove(const char* className); 00068 00072 const RuntimeType* get(const char* className) const; 00073 00079 void* createInstanceFromName(const char* className) const ML_RETURN_VALUE_SHOULD_BE_USED; 00080 00084 const RuntimeType* first(); 00085 00089 const RuntimeType* next(); 00090 00094 void destroyRuntimeTypesOfDll(const char* dllName); 00095 00102 std::list<const RuntimeType*> getAllDerivedFrom(const RuntimeType* parentType, 00103 bool onlyFromDifferentDlls=false); 00104 00107 std::list<const RuntimeType *> getAllRuntimeTypesOfDll(const char* dllName); 00108 00109 private: 00113 MLuint32 _hashValue(const char* string) const; 00114 00116 MLuint32 _arraySize; 00117 00119 RuntimeDictEntry **_array; 00120 00122 RuntimeDictEntry *_current; 00123 00125 MLuint32 _row; 00126 00130 bool _isInstanceCountCheckOnDestructionOn; 00131 }; 00132 00133 ML_UTILS_END_NAMESPACE 00134 00135 00136 00137 #endif // __mlRuntimeDict_H 00138 00139 00140 00141 00142