Changeset 4299 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- May 26, 2005, 3:07:59 PM (20 years ago)
- Location:
- orxonox/trunk/src/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/load_param.cc
r4285 r4299 27 27 \param ... the parameter information 28 28 */ 29 BaseLoadParam::BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...) 30 { 29 BaseLoadParam::BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, ...) 30 { 31 this->loadString = grabParameter(root, paramName); 32 31 33 this->paramDesc = NULL; 32 34 if (LoadClassDescription::parametersDescription) … … 47 49 strcpy(this->paramDesc->types[i], tmpTypeName); 48 50 } 49 va_end(types); 51 va_end(types); 50 52 51 53 int argCount = 0; -
orxonox/trunk/src/util/loading/load_param.h
r4261 r4299 65 65 #define LoadParam1(type1) \ 66 66 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE)) \ 67 : BaseLoadParam(pt2Object, paramName, 1, type1##_NAME) \ 68 { \ 69 const char* loadString = grabParameter(root, paramName); \ 67 : BaseLoadParam(root, pt2Object, paramName, 1, type1##_NAME) \ 68 { \ 70 69 if (loadString != NULL && root != NULL) \ 71 70 (*pt2Object.*function)(type1##_FUNC(loadString)); \ … … 78 77 #define LoadParam2(type1, type2) \ 79 78 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \ 80 : BaseLoadParam(pt2Object, paramName, 2, type1##_NAME, type2##_NAME) \ 81 { \ 82 const char* loadString = grabParameter(root, paramName); \ 79 : BaseLoadParam(root, pt2Object, paramName, 2, type1##_NAME, type2##_NAME) \ 80 { \ 83 81 if (loadString != NULL && root != NULL) \ 84 82 { \ … … 98 96 #define LoadParam3(type1, type2, type3) \ 99 97 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\ 100 : BaseLoadParam(pt2Object, paramName, 3, type1##_NAME, type2##_NAME, type3##_NAME) \ 101 { \ 102 const char* loadString = grabParameter(root, paramName); \ 98 : BaseLoadParam(root, pt2Object, paramName, 3, type1##_NAME, type2##_NAME, type3##_NAME) \ 99 { \ 103 100 if (loadString != NULL && root != NULL) \ 104 101 { \ … … 118 115 #define LoadParam4(type1, type2, type3, type4) \ 119 116 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \ 120 : BaseLoadParam(pt2Object, paramName, 4, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \ 121 { \ 122 const char* loadString = grabParameter(root, paramName); \ 117 : BaseLoadParam(root, pt2Object, paramName, 4, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \ 118 { \ 123 119 if (loadString != NULL && root != NULL) \ 124 120 { \ … … 138 134 #define LoadParam5(type1, type2, type3, type4, type5) \ 139 135 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, paramName, 5, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \ 141 { \ 142 const char* loadString = grabParameter(root, paramName); \ 136 : BaseLoadParam(root, pt2Object, paramName, 5, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \ 137 { \ 143 138 if (loadString != NULL && root != NULL) \ 144 139 { \ … … 202 197 203 198 protected: 204 BaseLoadParam( BaseObject* object, const char* paramName, int paramCount, ...);199 BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, ...); 205 200 206 201 protected: 207 202 LoadClassDescription* classDesc; //!< The LoadClassDescription of this LoadParameter 208 203 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 204 const char* loadString; //!< The string loaded by this LoadParam 209 205 }; 210 206
Note: See TracChangeset
for help on using the changeset viewer.