Changeset 4623 in orxonox.OLD for orxonox/trunk/src/util/loading/load_param.h
- Timestamp:
- Jun 13, 2005, 7:31:50 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/load_param.h
r4599 r4623 50 50 */ 51 51 52 #define l_INT_TYPE int //!< The type of an INT 53 #define l_INT_FUNC atoi //!< the function to call to parse INT 54 #define l_INT_NAME "int" //!< the name of an INT 55 56 #define l_LONG_TYPE long //!< The type of a LONG 57 #define l_LONG_FUNC atol //!< The function to parse a LONG 58 #define l_LONG_NAME "long" //!< The name of a LONG 59 60 #define l_SHORT_TYPE short //!< The type of a SHORT 61 #define l_SHORT_FUNC atoi //!< The function to parse a SHORT 62 #define l_SHORT_NAME "short" //!< The name of a SHORT 63 64 #define l_FLOAT_TYPE float //!< The type of a FLOAT 65 #define l_FLOAT_FUNC atof //!< The function to parse a FLOAT 66 #define l_FLOAT_NAME "float" //!< The name of a FLOAT 67 68 #define l_STRING_TYPE const char* //!< The type of a STRING 69 #define l_STRING_FUNC //!< The function to parse a STRING 70 #define l_STRING_NAME "string" //!< The name of a STRING 71 72 #define l_XML_ELEM_TYPE const TiXmlElement* //!< The type of an XML_ELEM 73 #define l_XML_ELEM_FUNC //!< The function to parse an XML_ELEM 74 #define l_XML_ELEM_NAME "XML" //!< The name of an XML_ELEM 75 52 #define l_INT_TYPE int //!< The type of an INT 53 #define l_INT_FUNC atoi //!< The function to call to parse INT 54 #define l_INT_NAME "int" //!< The name of an INT 55 #define l_INT_DEFAULT 0 //!< a default Value for an INT 56 57 #define l_LONG_TYPE long //!< The type of a LONG 58 #define l_LONG_FUNC atol //!< The function to parse a LONG 59 #define l_LONG_NAME "long" //!< The name of a LONG 60 #define l_LONG_DEFAULT 0 //!< a default Value for a LONG 61 62 // #define l_SHORT_TYPE short //!< The type of a SHORT 63 // #define l_SHORT_FUNC atoi //!< The function to parse a SHORT 64 // #define l_SHORT_NAME "short" //!< The name of a SHORT 65 // #define l_SHORT_DEFAULT 0 //!< a default Value for a SHORT 66 67 #define l_FLOAT_TYPE float //!< The type of a FLOAT 68 #define l_FLOAT_FUNC atof //!< The function to parse a FLOAT 69 #define l_FLOAT_NAME "float" //!< The name of a FLOAT 70 #define l_FLOAT_DEFAULT 0.0 //!< a default Value for a FLOAT 71 72 #define l_STRING_TYPE const char* //!< The type of a STRING 73 #define l_STRING_FUNC //!< The function to parse a STRING 74 #define l_STRING_NAME "string" //!< The name of a STRING 75 #define l_STRING_DEFAULT "" //!< a default Value for an STRING 76 77 #define l_XML_ELEM_TYPE const TiXmlElement* //!< The type of an XML_ELEM 78 #define l_XML_ELEM_FUNC //!< The function to parse an XML_ELEM 79 #define l_XML_ELEM_NAME "XML" //!< The name of an XML_ELEM 80 #define l_XML_ELEM_DEFAULT NULL //!< The dafault Value for an XML_ELEM 81 82 83 /***************************************** 84 **** MACROS DEFINITIONS OF LOADABLES ***** 85 *****************************************/ 76 86 // 1. TYPE 77 87 /** … … 80 90 */ 81 91 #define LoadParam1(type1) \ 82 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), bool multi = false) \ 83 : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_NAME) \ 92 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), \ 93 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT) \ 94 : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_NAME, default1) \ 84 95 { \ 85 96 if (loadString != NULL && root != NULL) \ … … 97 108 */ 98 109 #define LoadParam2(type1, type2) \ 99 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE), bool multi = false) \ 100 : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_NAME, type2##_NAME) \ 110 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE), \ 111 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT) \ 112 : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_NAME, default1, type2##_NAME, default2) \ 101 113 { \ 102 114 if (loadString != NULL && root != NULL) \ … … 122 134 */ 123 135 #define LoadParam3(type1, type2, type3) \ 124 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE), bool multi = false)\ 125 : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_NAME, type2##_NAME, type3##_NAME) \ 136 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE), \ 137 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT)\ 138 : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3) \ 126 139 { \ 127 140 if (loadString != NULL && root != NULL) \ … … 148 161 */ 149 162 #define LoadParam4(type1, type2, type3, type4) \ 150 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE), bool multi = false) \ 151 : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \ 163 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE), \ 164 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \ 165 type4##_TYPE default4 = type4##_DEFAULT) \ 166 : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3, \ 167 type4##_NAME, default4) \ 152 168 { \ 153 169 if (loadString != NULL && root != NULL) \ … … 175 191 */ 176 192 #define LoadParam5(type1, type2, type3, type4, type5) \ 177 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE), bool multi = false) \ 178 : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \ 193 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, \ 194 void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE), \ 195 bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \ 196 type4##_TYPE default4 = type4, ##_DEFAULTtype5##_TYPE default5 = type5##_DEFAULT ) \ 197 : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3, \ 198 type4##_NAME, default4, type5##_NAME, default5) \ 179 199 { \ 180 200 if (loadString != NULL && root != NULL) \ … … 221 241 void print(void) const; 222 242 private: 223 char* paramName; //!< The name of the parameter 224 int paramCount; //!< The count of parameters 243 char* paramName; //!< The name of the parameter. 244 int paramCount; //!< The count of parameters. 225 245 char** types; //!< What kind of parameters does this function take ?? 226 char* description; //!< A longer description about this function 246 char* description; //!< A longer description about this function. 247 char** defaultValues; //!< The 'Default Values'. 227 248 }; 228 249
Note: See TracChangeset
for help on using the changeset viewer.