Changeset 9742 in orxonox.OLD for branches/new_class_id/src
- Timestamp:
- Sep 16, 2006, 2:00:13 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/shell/shell_command.h
r9740 r9742 10 10 11 11 /// THIS IS USED TO LOAD CONSTANT AND STATIC FUNCTIONS EASILY. 12 #include "executor/executor_substring.h" 12 13 #include "executor/functor_member.h" 13 14 #include "executor/functor_const_member.h" -
branches/new_class_id/src/lib/util/Makefile.am
r9741 r9742 8 8 libORXexecutor_a_SOURCES = \ 9 9 executor/executor.cc \ 10 executor/executor_lua.cc 10 executor/executor_lua.cc \ 11 executor/executor_substring.cc 11 12 12 13 # executor/executor_functional.cc … … 48 49 executor/executor_xml.h \ 49 50 executor/executor_lua.h \ 50 executor/ functor_list.h \51 executor/executor_substring.h \ 51 52 executor/executor_generic.h \ 52 53 executor/executor_member.h \ 53 54 executor/executor_const_member.h \ 54 55 executor/executor_static.h \ 56 \ 57 executor/functor_list.h \ 55 58 executor/functor_generic.h \ 56 59 executor/functor_member.h \ -
branches/new_class_id/src/lib/util/executor/executor_generic.h
r9740 r9742 26 26 27 27 #include "executor.h" 28 #include "substring.h"29 30 31 template<typename type> type fromString(const std::string& input, type defaultValue) { return defaultValue; };32 template<> bool fromString<bool>(const std::string& input, bool defaultValue);33 template<> int fromString<int>(const std::string& input, int defaultValue);34 template<> unsigned int fromString<unsigned int>(const std::string& input, unsigned int defaultValue);35 template<> float fromString<float>(const std::string& input, float defaultValue);36 template<> char fromString<char>(const std::string& input, char defaultValue);37 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue);38 39 template<typename type> type fromMulti(const MultiType& multi) { /* return defaultValue; */ };40 template<> bool fromMulti<bool>(const MultiType& multi);41 template<> int fromMulti<int>(const MultiType& multi);42 template<> unsigned int fromMulti<unsigned int>(const MultiType& multi);43 template<> float fromMulti<float>(const MultiType& multi);44 template<> char fromMulti<char>(const MultiType& multi);45 template<> const std::string& fromMulti<const std::string&>(const MultiType& multi);46 47 48 template<typename type> type getDefault(const MultiType* const defaultValues, unsigned int i) { return (type)0; };49 template<> bool getDefault<bool>(const MultiType* const defaultValues, unsigned int i);50 template<> int getDefault<int>(const MultiType* const defaultValues, unsigned int i);51 template<> unsigned int getDefault<unsigned int>(const MultiType* const defaultValues, unsigned int i);52 template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i);53 template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i);54 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i);55 56 57 28 /** 58 29 * @brief this is a Template Class used as an evaluater. … … 78 49 ToType operator()(FromType& CallValue, const MultiType* const defaults) 79 50 { 80 return defaultValue; /*(CallValue.size() > index) ? 81 fromString<ToType>(CallValue[index], getDefault<ToType>(defaults, index)) : 82 fromMulti<ToType>(defaults[index]); */ 51 return defaultValue; 83 52 } 84 static FromType& defaultValue() { return FromType(); }; 85 }; 86 87 /** 88 * @brief to remove writing errors, this function is Used. 89 * @param sub The SubString to use 90 * @param default The default Values. 91 */ 92 template<> class ExecutorEvaluater <const SubString> 93 { 94 public: 95 /** @brief Executes the Evaluater 96 * @param CallValue the Value that should be converted 97 * @param defaults the default Values. 98 */ 99 template <typename ToType, int index> 100 ToType operator()(const SubString& CallValue, const MultiType* const defaults) 101 { 102 return (CallValue.size() > index) ? 103 fromString<ToType>(CallValue[index], getDefault<ToType>(defaults, index)) : 104 fromMulti<ToType>(defaults[index]); 105 } 106 static const SubString& defaultValue() { return SubString::NullSubString; }; 107 }; 108 53 static FromType& defaultValue() { static FromType defaultValue; return defaultValue; }; 54 }; 109 55 #endif /* __EXECUTOR_GENERIC_H_ */ 110 56 57 #ifdef __EXECUTOR_FUNCTIONAL_NAME 111 58 112 59 /////////// … … 135 82 * @brief executes the Functional 136 83 * @param object the Object the action should be executed on. 137 * @param sub the SubStringto get the Parameters from.138 */ 139 virtual void operator()(BaseObject* object, CallType& sub= Evaluater<CallType>::defaultValue()) const84 * @param eval the CallType to get the Parameters from. 85 */ 86 virtual void operator()(BaseObject* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 140 87 { 141 88 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(); … … 181 128 * @brief executes the Functional 182 129 * @param object the Object the action should be executed on. 183 * @param sub the SubStringto get the Parameters from.184 */ 185 virtual void operator()(BaseObject* object, CallType& sub= Evaluater<CallType>::defaultValue()) const186 { 187 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 188 Evaluater<CallType>().template operator()<type0, 0>( sub, this->defaultValue));130 * @param eval the CallType to get the Parameters from. 131 */ 132 virtual void operator()(BaseObject* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 133 { 134 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 135 Evaluater<CallType>().template operator()<type0, 0>(eval, this->defaultValue)); 189 136 }; 190 137 … … 228 175 * @brief executes the Functional 229 176 * @param object the Object the action should be executed on. 230 * @param sub the SubStringto get the Parameters from.231 */ 232 virtual void operator()(BaseObject* object, CallType& sub= Evaluater<CallType>::defaultValue()) const233 { 234 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 235 Evaluater<CallType>().template operator()<type0, 0>( sub, this->defaultValue),236 Evaluater<CallType>().template operator()<type1, 1>( sub, this->defaultValue));177 * @param eval the CallType to get the Parameters from. 178 */ 179 virtual void operator()(BaseObject* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 180 { 181 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 182 Evaluater<CallType>().template operator()<type0, 0>(eval, this->defaultValue), 183 Evaluater<CallType>().template operator()<type1, 1>(eval, this->defaultValue)); 237 184 }; 238 185 … … 276 223 * @brief executes the Functional 277 224 * @param object the Object the action should be executed on. 278 * @param sub the SubStringto get the Parameters from.279 */ 280 virtual void operator()(BaseObject* object, CallType& sub= Evaluater<CallType>::defaultValue()) const281 { 282 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 283 Evaluater<CallType>().template operator()<type0, 0>( sub, this->defaultValue),284 Evaluater<CallType>().template operator()<type1, 1>( sub, this->defaultValue),285 Evaluater<CallType>().template operator()<type2, 2>( sub, this->defaultValue));225 * @param eval the CallType to get the Parameters from. 226 */ 227 virtual void operator()(BaseObject* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 228 { 229 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 230 Evaluater<CallType>().template operator()<type0, 0>(eval, this->defaultValue), 231 Evaluater<CallType>().template operator()<type1, 1>(eval, this->defaultValue), 232 Evaluater<CallType>().template operator()<type2, 2>(eval, this->defaultValue)); 286 233 }; 287 234 … … 325 272 * @brief executes the Functional 326 273 * @param object the Object the action should be executed on. 327 * @param sub the SubStringto get the Parameters from.328 */ 329 virtual void operator()(BaseObject* object, CallType& sub= Evaluater<CallType>::defaultValue()) const330 { 331 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 332 Evaluater<CallType>().template operator()<type0, 0>( sub, this->defaultValue),333 Evaluater<CallType>().template operator()<type1, 1>( sub, this->defaultValue),334 Evaluater<CallType>().template operator()<type2, 2>( sub, this->defaultValue),335 Evaluater<CallType>().template operator()<type3, 3>( sub, this->defaultValue));274 * @param eval the CallType to get the Parameters from. 275 */ 276 virtual void operator()(BaseObject* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 277 { 278 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 279 Evaluater<CallType>().template operator()<type0, 0>(eval, this->defaultValue), 280 Evaluater<CallType>().template operator()<type1, 1>(eval, this->defaultValue), 281 Evaluater<CallType>().template operator()<type2, 2>(eval, this->defaultValue), 282 Evaluater<CallType>().template operator()<type3, 3>(eval, this->defaultValue)); 336 283 }; 337 284 … … 376 323 * @brief executes the Functional 377 324 * @param object the Object the action should be executed on. 378 * @param sub the SubStringto get the Parameters from.379 */ 380 virtual void operator()(BaseObject* object, CallType& sub= Evaluater<CallType>::defaultValue()) const381 { 382 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 383 Evaluater<CallType>().template operator()<type0, 0>( sub, this->defaultValue),384 Evaluater<CallType>().template operator()<type1, 1>( sub, this->defaultValue),385 Evaluater<CallType>().template operator()<type2, 2>( sub, this->defaultValue),386 Evaluater<CallType>().template operator()<type3, 3>( sub, this->defaultValue),387 Evaluater<CallType>().template operator()<type4, 4>( sub, this->defaultValue));325 * @param eval the CallType to get the Parameters from. 326 */ 327 virtual void operator()(BaseObject* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 328 { 329 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 330 Evaluater<CallType>().template operator()<type0, 0>(eval, this->defaultValue), 331 Evaluater<CallType>().template operator()<type1, 1>(eval, this->defaultValue), 332 Evaluater<CallType>().template operator()<type2, 2>(eval, this->defaultValue), 333 Evaluater<CallType>().template operator()<type3, 3>(eval, this->defaultValue), 334 Evaluater<CallType>().template operator()<type4, 4>(eval, this->defaultValue)); 388 335 }; 389 336 … … 398 345 }; 399 346 400 //#endif /* __EXECUTOR_GENERIC_H_*/347 #endif /* __EXECUTOR_FUNCTIONAL_NAME */ -
branches/new_class_id/src/lib/util/executor/executor_substring.cc
r9735 r9742 14 14 */ 15 15 16 #include "executor_ functional.h"16 #include "executor_substring.h" 17 17 #include "helper_functions.h" 18 18 -
branches/new_class_id/src/lib/util/executor/executor_substring.h
r9740 r9742 21 21 22 22 23 #ifndef __EXECUTOR_ GENERIC_H_24 #define __EXECUTOR_ GENERIC_H_23 #ifndef __EXECUTOR_SUBSTRING_H_ 24 #define __EXECUTOR_SUBSTRING_H_ 25 25 26 26 27 #include "executor .h"27 #include "executor_generic.h" 28 28 #include "substring.h" 29 29 … … 56 56 57 57 /** 58 * @brief this is a Template Class used as an evaluater.59 *60 * Trait to determine a default Value for any Type,61 * and to define the Convertible, and how it is transformed into the62 * corresponding SubTypes over the operator().63 *64 * This Class must be reimplemented for each Convertible and all of its65 * conversion-members.66 *67 * e.g: Convertible SubSting, that splits up into many Stings68 * conversion-members: (int) can be transformed from a String.69 */70 template<typename FromType> class ExecutorEvaluater71 {72 public:73 /** @brief Executes the Evaluater74 * @param CallValue the Value that should be converted75 * @param defaults the default Values.76 */77 template <typename ToType, int index>78 ToType operator()(FromType& CallValue, const MultiType* const defaults)79 {80 return defaultValue; /*(CallValue.size() > index) ?81 fromString<ToType>(CallValue[index], getDefault<ToType>(defaults, index)) :82 fromMulti<ToType>(defaults[index]); */83 }84 static FromType& defaultValue() { return FromType(); };85 };86 87 /**88 58 * @brief to remove writing errors, this function is Used. 89 59 * @param sub The SubString to use … … 107 77 }; 108 78 109 #endif /* __EXECUTOR_GENERIC_H_ */ 110 111 112 /////////// 113 //// 0 //// 114 /////////// 115 //! @brief ExecutorClass, that can execute Functions without any parameters. 116 template<class T, typename CallType, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject> 117 class __EXECUTOR_FUNCTIONAL_NAME(0) :public Executor<CallType, BaseClass> 118 { 119 private: 120 /** @brief the FunctioPointer. */ 121 void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST; 122 123 public: 124 /** 125 * @brief constructs the Executor. 126 * @param __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER the FunctionPointer to the Calling Function. 127 */ 128 __EXECUTOR_FUNCTIONAL_NAME(0) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST ) 129 : Executor<CallType, BaseClass>(false, __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE) 130 { 131 this->functionPointer = functionPointer; 132 }; 133 134 /** 135 * @brief executes the Functional 136 * @param object the Object the action should be executed on. 137 * @param sub the SubString to get the Parameters from. 138 */ 139 virtual void operator()(BaseObject* object, CallType& sub = Evaluater<CallType>::defaultValue()) const 140 { 141 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(); 142 }; 143 144 /** 145 * @brief copies the Executor 146 * @returns a new Executor that's a copy of this one. 147 */ 148 virtual Executor<CallType, BaseClass>* clone() const 149 { 150 return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, CallType>(this->functionPointer); 151 }; 152 }; 153 154 155 156 157 158 /////////// 159 //// 1 //// 160 /////////// 161 //! @brief ExecutorClass, that can execute Functions with one parameter. 162 template<class T, typename CallType, typename type0, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject> 163 class __EXECUTOR_FUNCTIONAL_NAME(1) : public Executor<CallType, BaseClass> 164 { 165 private: 166 /** @brief the FunctioPointer. */ 167 void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST; 168 169 public: 170 /** 171 * @brief constructs the Executor. 172 * @param __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER the FunctionPointer to the Calling Function. 173 */ 174 __EXECUTOR_FUNCTIONAL_NAME(1) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) 175 : Executor<CallType, BaseClass>(false, ExecutorParamType<type0>(), __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE) 176 { 177 this->functionPointer = functionPointer; 178 }; 179 180 /** 181 * @brief executes the Functional 182 * @param object the Object the action should be executed on. 183 * @param sub the SubString to get the Parameters from. 184 */ 185 virtual void operator()(BaseObject* object, CallType& sub = Evaluater<CallType>::defaultValue()) const 186 { 187 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 188 Evaluater<CallType>().template operator()<type0, 0>(sub, this->defaultValue)); 189 }; 190 191 /** 192 * @brief copies the Executor 193 * @returns a new Executor that's a copy of this one. 194 */ 195 virtual Executor<CallType, BaseClass>* clone() const 196 { 197 return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, CallType, type0>(this->functionPointer); 198 }; 199 }; 200 201 202 203 204 205 /////////// 206 //// 2 //// 207 /////////// 208 //! @brief ExecutorClass, that can execute Functions with two parameters. 209 template<class T, typename CallType, typename type0, typename type1, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject> 210 class __EXECUTOR_FUNCTIONAL_NAME(2) : public Executor<CallType, BaseClass> 211 { 212 private: 213 /** @brief the FunctioPointer. */ 214 void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST; 215 216 public: 217 /** 218 * @brief constructs the Executor. 219 * @param __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER the FunctionPointer to the Calling Function. 220 */ 221 __EXECUTOR_FUNCTIONAL_NAME(2) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) 222 : Executor<CallType, BaseClass>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE) 223 { 224 this->functionPointer = functionPointer; 225 }; 226 227 /** 228 * @brief executes the Functional 229 * @param object the Object the action should be executed on. 230 * @param sub the SubString to get the Parameters from. 231 */ 232 virtual void operator()(BaseObject* object, CallType& sub = Evaluater<CallType>::defaultValue()) const 233 { 234 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 235 Evaluater<CallType>().template operator()<type0, 0>(sub, this->defaultValue), 236 Evaluater<CallType>().template operator()<type1, 1>(sub, this->defaultValue)); 237 }; 238 239 /** 240 * @brief copies the Executor 241 * @returns a new Executor that's a copy of this one. 242 */ 243 virtual Executor<CallType, BaseClass>* clone() const 244 { 245 return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, CallType, type0, type1>(this->functionPointer); 246 }; 247 }; 248 249 250 251 252 253 /////////// 254 //// 3 //// 255 /////////// 256 //! @brief ExecutorClass, that can execute Functions with three parameters. 257 template<class T, typename CallType, typename type0, typename type1, typename type2, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject> 258 class __EXECUTOR_FUNCTIONAL_NAME(3) : public Executor<CallType, BaseClass> 259 { 260 private: 261 /** @brief the FunctioPointer. */ 262 void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST; 263 264 public: 265 /** 266 * @brief constructs the Executor. 267 * @param __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER the FunctionPointer to the Calling Function. 268 */ 269 __EXECUTOR_FUNCTIONAL_NAME(3) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) 270 : Executor<CallType, BaseClass>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE) 271 { 272 this->functionPointer = functionPointer; 273 }; 274 275 /** 276 * @brief executes the Functional 277 * @param object the Object the action should be executed on. 278 * @param sub the SubString to get the Parameters from. 279 */ 280 virtual void operator()(BaseObject* object, CallType& sub = Evaluater<CallType>::defaultValue()) const 281 { 282 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 283 Evaluater<CallType>().template operator()<type0, 0>(sub, this->defaultValue), 284 Evaluater<CallType>().template operator()<type1, 1>(sub, this->defaultValue), 285 Evaluater<CallType>().template operator()<type2, 2>(sub, this->defaultValue)); 286 }; 287 288 /** 289 * @brief copies the Executor 290 * @returns a new Executor that's a copy of this one. 291 */ 292 virtual Executor<CallType, BaseClass>* clone() const 293 { 294 return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, CallType, type0, type1, type2>(this->functionPointer); 295 }; 296 }; 297 298 299 300 301 302 /////////// 303 //// 4 //// 304 /////////// 305 //! @brief ExecutorClass, that can execute Functions with four parameters. 306 template<class T, typename CallType, typename type0, typename type1, typename type2, typename type3, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject> 307 class __EXECUTOR_FUNCTIONAL_NAME(4) : public Executor<CallType, BaseClass> 308 { 309 private: 310 /** @brief the FunctioPointer. */ 311 void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST; 312 313 public: 314 /** 315 * @brief constructs the Executor. 316 * @param __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER the FunctionPointer to the Calling Function. 317 */ 318 __EXECUTOR_FUNCTIONAL_NAME(4) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) 319 : Executor<CallType, BaseClass>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), ExecutorParamType<type3>(), __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE) 320 { 321 this->functionPointer = functionPointer; 322 }; 323 324 /** 325 * @brief executes the Functional 326 * @param object the Object the action should be executed on. 327 * @param sub the SubString to get the Parameters from. 328 */ 329 virtual void operator()(BaseObject* object, CallType& sub = Evaluater<CallType>::defaultValue()) const 330 { 331 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 332 Evaluater<CallType>().template operator()<type0, 0>(sub, this->defaultValue), 333 Evaluater<CallType>().template operator()<type1, 1>(sub, this->defaultValue), 334 Evaluater<CallType>().template operator()<type2, 2>(sub, this->defaultValue), 335 Evaluater<CallType>().template operator()<type3, 3>(sub, this->defaultValue)); 336 }; 337 338 /** 339 * @brief copies the Executor 340 * @returns a new Executor that's a copy of this one. 341 */ 342 virtual Executor<CallType, BaseClass>* clone() const 343 { 344 return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, CallType, type0, type1, type2, type3>(this->functionPointer); 345 }; 346 }; 347 348 349 350 351 352 353 /////////// 354 //// 5 //// 355 /////////// 356 //! @brief ExecutorClass, that can execute Functions with five parameters. 357 template<class T, typename CallType, typename type0, typename type1, typename type2, typename type3, typename type4, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject> 358 class __EXECUTOR_FUNCTIONAL_NAME(5) : public Executor<CallType, BaseClass> 359 { 360 private: 361 /** @brief the FunctioPointer. */ 362 void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST; 363 364 public: 365 /** 366 * @brief constructs the Executor. 367 * @param __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER the FunctionPointer to the Calling Function. 368 */ 369 __EXECUTOR_FUNCTIONAL_NAME(5) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) 370 : Executor<CallType, BaseClass>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), ExecutorParamType<type3>(), ExecutorParamType<type4>(), __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE) 371 { 372 this->functionPointer = functionPointer; 373 }; 374 375 /** 376 * @brief executes the Functional 377 * @param object the Object the action should be executed on. 378 * @param sub the SubString to get the Parameters from. 379 */ 380 virtual void operator()(BaseObject* object, CallType& sub = Evaluater<CallType>::defaultValue()) const 381 { 382 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 383 Evaluater<CallType>().template operator()<type0, 0>(sub, this->defaultValue), 384 Evaluater<CallType>().template operator()<type1, 1>(sub, this->defaultValue), 385 Evaluater<CallType>().template operator()<type2, 2>(sub, this->defaultValue), 386 Evaluater<CallType>().template operator()<type3, 3>(sub, this->defaultValue), 387 Evaluater<CallType>().template operator()<type4, 4>(sub, this->defaultValue)); 388 }; 389 390 /** 391 * @brief copies the Executor 392 * @returns a new Executor that's a copy of this one. 393 */ 394 virtual Executor<CallType, BaseClass>* clone() const 395 { 396 return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, CallType, type0, type1, type2, type3, type4>(this->functionPointer); 397 }; 398 }; 399 400 //#endif /* __EXECUTOR_GENERIC_H_ */ 79 #endif /* __EXECUTOR_SUBSTRING_H_ */ -
branches/new_class_id/src/lib/util/loading/load_param.h
r9740 r9742 24 24 #include "base_object.h" 25 25 26 #include "executor/executor_substring.h" 26 27 #include "executor/executor_member.h" 27 28 #include "executor/functor_member.h"
Note: See TracChangeset
for help on using the changeset viewer.