Changeset 5545 in orxonox.OLD for trunk/src/util
- Timestamp:
- Nov 11, 2005, 4:32:28 PM (19 years ago)
- Location:
- trunk/src/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/loading/load_param.cc
r5534 r5545 31 31 * @param ...: the parameter information (1. Parameter, 2. Default Value for the Parameter, ...) 32 32 */ 33 BaseLoadParam::BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName,33 LoadParamBase::LoadParamBase(const TiXmlElement* root, BaseObject* object, const char* paramName, 34 34 int paramCount, bool multi, const void* pointerToParam, ...) 35 35 { … … 110 110 * @returns a pointer to itself. 111 111 */ 112 BaseLoadParam* BaseLoadParam::describe(const char* descriptionText)112 LoadParamBase* LoadParamBase::describe(const char* descriptionText) 113 113 { 114 114 if (LoadClassDescription::parametersDescription && this->paramDesc && !this->paramDesc->getDescription()) -
trunk/src/util/loading/load_param.h
r5499 r5545 40 40 class LoadParamDescription 41 41 { 42 friend class BaseLoadParam;42 friend class LoadParamBase; 43 43 friend class LoadClassDescription; 44 44 public: … … 62 62 class LoadClassDescription 63 63 { 64 friend class BaseLoadParam;64 friend class LoadParamBase; 65 65 public: 66 66 LoadClassDescription(const char* className); … … 88 88 **************************/ 89 89 //! abstract Base class for a Loadable parameter 90 class BaseLoadParam: public BaseObject90 class LoadParamBase : public BaseObject 91 91 { 92 92 public: 93 BaseLoadParam* describe(const char* descriptionText);93 LoadParamBase* describe(const char* descriptionText); 94 94 95 95 protected: 96 BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, bool multi, const void* pointerToParam, ...);96 LoadParamBase(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, bool multi, const void* pointerToParam, ...); 97 97 98 98 protected: … … 140 140 #define LoadParam0() \ 141 141 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(), bool multi = false) \ 142 : BaseLoadParam(root, pt2Object, paramName, 0, multi, NULL, "") \142 : LoadParamBase(root, pt2Object, paramName, 0, multi, NULL, "") \ 143 143 { \ 144 144 if (loadString != NULL && root != NULL) \ … … 156 156 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), \ 157 157 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT) \ 158 : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_PARAM, default1) \158 : LoadParamBase(root, pt2Object, paramName, 1, multi, NULL, type1##_PARAM, default1) \ 159 159 { \ 160 160 if (loadString != NULL && root != NULL) \ … … 175 175 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE), \ 176 176 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT) \ 177 : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2) \177 : LoadParamBase(root, pt2Object, paramName, 2, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2) \ 178 178 { \ 179 179 if (loadString != NULL && root != NULL) \ … … 201 201 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE), \ 202 202 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT)\ 203 : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3) \203 : LoadParamBase(root, pt2Object, paramName, 3, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3) \ 204 204 { \ 205 205 if (loadString != NULL && root != NULL) \ … … 229 229 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \ 230 230 type4##_TYPE default4 = type4##_DEFAULT) \ 231 : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3, \231 : LoadParamBase(root, pt2Object, paramName, 4, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3, \ 232 232 type4##_PARAM, default4) \ 233 233 { \ … … 260 260 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \ 261 261 type4##_TYPE default4 = type4##_DEFAULT, type5##_TYPE default5 = type5##_DEFAULT ) \ 262 : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3, \262 : LoadParamBase(root, pt2Object, paramName, 5, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3, \ 263 263 type4##_PARAM, default4, type5##_PARAM, default5) \ 264 264 { \ … … 283 283 #define LoadParamPT(type1) \ 284 284 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), type1##_TYPE pointerToParam, bool multi = false) \ 285 : BaseLoadParam(root, pt2Object, paramName, 1, multi, pointerToParam, type1##_PARAM) \285 : LoadParamBase(root, pt2Object, paramName, 1, multi, pointerToParam, type1##_PARAM) \ 286 286 { \ 287 287 if (pointerToParam != NULL && root != NULL) \ … … 292 292 293 293 //! derived template class, so all the Classes can load something. 294 template<class T> class LoadParam : public BaseLoadParam294 template<class T> class LoadParam : public LoadParamBase 295 295 { 296 296 public: … … 305 305 // loads a Ti-XML-element 306 306 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const TiXmlElement*), bool multi = false) 307 : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, "XML")307 : LoadParamBase(root, pt2Object, paramName, 1, multi, NULL, "XML") 308 308 { 309 309 if (root != NULL)
Note: See TracChangeset
for help on using the changeset viewer.