Changeset 4254 in orxonox.OLD for orxonox/branches/levelLoader/src/util/loading/load_param.h
- Timestamp:
- May 22, 2005, 1:43:16 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelLoader/src/util/loading/load_param.h
r4253 r4254 65 65 #define LoadParam1(type1) \ 66 66 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE)) \ 67 : BaseLoadParam(pt2Object, type1##_NAME) \67 : BaseLoadParam(pt2Object, paramName, 1, type1##_NAME) \ 68 68 { \ 69 69 const char* loadString = grabParameter(root, paramName); \ … … 78 78 #define LoadParam2(type1, type2) \ 79 79 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \ 80 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME) \80 : BaseLoadParam(pt2Object, paramName, 2, type1##_NAME, type2##_NAME) \ 81 81 { \ 82 82 const char* loadString = grabParameter(root, paramName); \ … … 98 98 #define LoadParam3(type1, type2, type3) \ 99 99 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\ 100 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME) \100 : BaseLoadParam(pt2Object, paramName, 3, type1##_NAME, type2##_NAME, type3##_NAME) \ 101 101 { \ 102 102 const char* loadString = grabParameter(root, paramName); \ … … 118 118 #define LoadParam4(type1, type2, type3, type4) \ 119 119 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \ 120 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \120 : BaseLoadParam(pt2Object, paramName, 4, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \ 121 121 { \ 122 122 const char* loadString = grabParameter(root, paramName); \ … … 138 138 #define LoadParam5(type1, type2, type3, type4, type5) \ 139 139 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE)) \ 140 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \140 : BaseLoadParam(pt2Object, paramName, 5, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \ 141 141 { \ 142 142 const char* loadString = grabParameter(root, paramName); \ … … 155 155 156 156 157 158 #define CREATE_LOAD_DOC(CLASS_NAME) \159 void documentLoadClass##CLASS_NAME(void) \160 { \161 if(LoadClassDescription::parametersDescription) \162 { \163 CLASS_NAME docuClass; \164 docuClass.loadParams(NULL); \165 } \166 }167 // documentLoadClass();168 169 170 157 class LoadParamDescription 171 158 { 159 friend class BaseLoadParam; 160 friend class LoadClassDescription; 161 public: 162 LoadParamDescription(const char* paramName); 163 ~LoadParamDescription(void); 172 164 private: 165 char* paramName; 173 166 int paramCount; 174 167 char** types; 175 const char* className;176 177 168 }; 178 169 179 170 class LoadClassDescription 180 171 { 172 friend class BaseLoadParam; 181 173 public: 182 174 LoadClassDescription(const char* className); 175 ~LoadClassDescription(void); 176 177 static LoadClassDescription* addClass(const char* className); 178 LoadParamDescription* addParam(const char* paramName); 183 179 184 180 static bool parametersDescription; 185 181 182 static tList<LoadClassDescription>* classList; 186 183 private: 184 char* className; 187 185 tList<LoadParamDescription>* paramList; 188 186 }; … … 192 190 { 193 191 protected: 194 BaseLoadParam(BaseObject* object, const char* type1 = NULL, const char* type2 = NULL,195 const char* type3 = NULL, const char* type4 = NULL, const char* type5 = NULL);192 BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...); 193 void describe(const char* descriptionText); 196 194 197 195 protected: 198 LoadParamDescription* description; 196 LoadClassDescription* classDesc; 197 LoadParamDescription* paramDesc; 199 198 }; 200 199
Note: See TracChangeset
for help on using the changeset viewer.