Changeset 4592 in orxonox.OLD for orxonox/trunk/src/util/loading
- Timestamp:
- Jun 10, 2005, 7:17:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/load_param.h
r4501 r4592 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 14 14 */ 15 15 16 /*! 16 /*! 17 17 \file load_param.h 18 18 \brief A Class and macro-functions, that makes our lives easy to load-in parameters … … 74 74 #define LoadParam1(type1) \ 75 75 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), bool multi = false) \ 76 : BaseLoadParam(root, pt2Object, paramName, 1, multi, type1##_NAME) 77 { \ 78 if (loadString != NULL && root != NULL) \ 79 80 else \ 81 76 : BaseLoadParam(root, pt2Object, paramName, 1, multi, type1##_NAME) \ 77 { \ 78 if (loadString != NULL && root != NULL) \ 79 (*pt2Object.*function)(type1##_FUNC(loadString)); \ 80 else \ 81 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 82 82 } 83 83 … … 94 94 { \ 95 95 if (loadString != NULL && root != NULL) \ 96 97 98 99 100 101 102 103 104 else \ 105 96 { \ 97 SubString subLoads(loadString); \ 98 if (subLoads.getCount() == 2) \ 99 (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1))); \ 100 else \ 101 PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \ 102 paramName, pt2Object->getClassName(), 2, subLoads.getCount()); \ 103 } \ 104 else \ 105 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 106 106 } 107 107 … … 119 119 { \ 120 120 if (loadString != NULL && root != NULL) \ 121 122 123 124 125 126 127 128 129 else \ 130 121 { \ 122 SubString subLoads(loadString); \ 123 if (subLoads.getCount() == 3) \ 124 (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1)), type3##_FUNC(subLoads.getString(2))); \ 125 else \ 126 PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \ 127 paramName, pt2Object->getClassName(), 3, subLoads.getCount()); \ 128 } \ 129 else \ 130 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 131 131 } 132 132 … … 145 145 { \ 146 146 if (loadString != NULL && root != NULL) \ 147 148 149 150 151 152 153 154 155 else \ 156 147 { \ 148 SubString subLoads(loadString); \ 149 if (subLoads.getCount() == 4) \ 150 (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1)), type3##_FUNC(subLoads.getString(2)), type4##_FUNC(subLoads.getString(3))); \ 151 else \ 152 PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \ 153 paramName, pt2Object->getClassName(), 4, subLoads.getCount()); \ 154 } \ 155 else \ 156 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 157 157 } 158 158 … … 172 172 { \ 173 173 if (loadString != NULL && root != NULL) \ 174 175 176 177 178 179 180 181 182 else \ 183 174 { \ 175 SubString subLoads(loadString); \ 176 if (subLoads.getCount() == 5) \ 177 (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1)), type3##_FUNC(subLoads.getString(2)), type4##_FUNC(subLoads.getString(3)), type5##_FUNC(subLoads.getString(4))); \ 178 else \ 179 PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \ 180 paramName, pt2Object->getClassName(), 5, subLoads.getCount()); \ 181 } \ 182 else \ 183 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 184 184 } 185 185 … … 216 216 static LoadClassDescription* addClass(const char* className); 217 217 LoadParamDescription* addParam(const char* paramName); 218 218 219 219 220 220 static void printAll(const char* fileName = NULL); … … 249 249 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(), bool multi = false) 250 250 : BaseLoadParam(root, pt2Object, paramName, 0, multi, "") 251 { 251 { 252 252 if (loadString != NULL && root != NULL) 253 (*pt2Object.*function)(); 254 else 255 253 (*pt2Object.*function)(); 254 else 255 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); 256 256 } 257 257
Note: See TracChangeset
for help on using the changeset viewer.