Changeset 9769 in orxonox.OLD for branches/new_class_id/src/lib/util/executor
- Timestamp:
- Sep 19, 2006, 9:35:11 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/util/executor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/executor/executor.h
r9752 r9769 112 112 113 113 /** @returns the Clone as a new Copy of the Executor. */ 114 virtual Executor<CallType >* clone () const = 0;114 virtual Executor<CallType, BaseClass>* clone () const = 0; 115 115 116 116 -
branches/new_class_id/src/lib/util/executor/executor_generic.h
r9748 r9769 68 68 /////////// 69 69 //! @brief ExecutorClass, that can execute Functions without any parameters. 70 template<class T, typename CallType, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>70 template<class T, typename CallType, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 71 71 class __EXECUTOR_FUNCTIONAL_NAME(0,) :public Executor<CallType, BaseClass> 72 72 { … … 89 89 * @param eval the CallType to get the Parameters from. 90 90 */ 91 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const91 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 92 92 { 93 93 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(); … … 100 100 virtual Executor<CallType, BaseClass>* clone() const 101 101 { 102 return new __EXECUTOR_FUNCTIONAL_NAME(0,)<T, CallType >(this->functionPointer);102 return new __EXECUTOR_FUNCTIONAL_NAME(0,)<T, CallType, BaseClass>(this->functionPointer); 103 103 }; 104 104 }; … … 110 110 /////////// 111 111 //! @brief ExecutorClass, that can execute Functions with one parameter. 112 template<class T, typename CallType, typename type0, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>112 template<class T, typename CallType, typename type0, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 113 113 class __EXECUTOR_FUNCTIONAL_NAME(1,) : public Executor<CallType, BaseClass> 114 114 { … … 131 131 * @param eval the CallType to get the Parameters from. 132 132 */ 133 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const133 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 134 134 { 135 135 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 143 143 virtual Executor<CallType, BaseClass>* clone() const 144 144 { 145 return new __EXECUTOR_FUNCTIONAL_NAME(1,)<T, CallType, type0 >(this->functionPointer);145 return new __EXECUTOR_FUNCTIONAL_NAME(1,)<T, CallType, type0, BaseClass>(this->functionPointer); 146 146 }; 147 147 }; … … 153 153 /////////// 154 154 //! @brief ExecutorClass, that can execute Functions with two parameters. 155 template<class T, typename CallType, typename type0, typename type1, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>155 template<class T, typename CallType, typename type0, typename type1, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 156 156 class __EXECUTOR_FUNCTIONAL_NAME(2,) : public Executor<CallType, BaseClass> 157 157 { … … 174 174 * @param eval the CallType to get the Parameters from. 175 175 */ 176 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const176 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 177 177 { 178 178 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 187 187 virtual Executor<CallType, BaseClass>* clone() const 188 188 { 189 return new __EXECUTOR_FUNCTIONAL_NAME(2,)<T, CallType, type0, type1 >(this->functionPointer);189 return new __EXECUTOR_FUNCTIONAL_NAME(2,)<T, CallType, type0, type1, BaseClass>(this->functionPointer); 190 190 }; 191 191 }; … … 197 197 /////////// 198 198 //! @brief ExecutorClass, that can execute Functions with three parameters. 199 template<class T, typename CallType, typename type0, typename type1, typename type2, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>199 template<class T, typename CallType, typename type0, typename type1, typename type2, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 200 200 class __EXECUTOR_FUNCTIONAL_NAME(3,) : public Executor<CallType, BaseClass> 201 201 { … … 218 218 * @param eval the CallType to get the Parameters from. 219 219 */ 220 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const220 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 221 221 { 222 222 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 232 232 virtual Executor<CallType, BaseClass>* clone() const 233 233 { 234 return new __EXECUTOR_FUNCTIONAL_NAME(3,)<T, CallType, type0, type1, type2 >(this->functionPointer);234 return new __EXECUTOR_FUNCTIONAL_NAME(3,)<T, CallType, type0, type1, type2, BaseClass>(this->functionPointer); 235 235 }; 236 236 }; … … 242 242 /////////// 243 243 //! @brief ExecutorClass, that can execute Functions with four parameters. 244 template<class T, typename CallType, typename type0, typename type1, typename type2, typename type3, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>244 template<class T, typename CallType, typename type0, typename type1, typename type2, typename type3, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 245 245 class __EXECUTOR_FUNCTIONAL_NAME(4,) : public Executor<CallType, BaseClass> 246 246 { … … 263 263 * @param eval the CallType to get the Parameters from. 264 264 */ 265 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const265 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 266 266 { 267 267 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 278 278 virtual Executor<CallType, BaseClass>* clone() const 279 279 { 280 return new __EXECUTOR_FUNCTIONAL_NAME(4,)<T, CallType, type0, type1, type2, type3 >(this->functionPointer);280 return new __EXECUTOR_FUNCTIONAL_NAME(4,)<T, CallType, type0, type1, type2, type3, BaseClass>(this->functionPointer); 281 281 }; 282 282 }; … … 288 288 /////////// 289 289 //! @brief ExecutorClass, that can execute Functions with five parameters. 290 template<class T, typename CallType, typename type0, typename type1, typename type2, typename type3, typename type4, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>290 template<class T, typename CallType, typename type0, typename type1, typename type2, typename type3, typename type4, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 291 291 class __EXECUTOR_FUNCTIONAL_NAME(5,) : public Executor<CallType, BaseClass> 292 292 { … … 309 309 * @param eval the CallType to get the Parameters from. 310 310 */ 311 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const311 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 312 312 { 313 313 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 325 325 virtual Executor<CallType, BaseClass>* clone() const 326 326 { 327 return new __EXECUTOR_FUNCTIONAL_NAME(5,)<T, CallType, type0, type1, type2, type3, type4 >(this->functionPointer);327 return new __EXECUTOR_FUNCTIONAL_NAME(5,)<T, CallType, type0, type1, type2, type3, type4, BaseClass>(this->functionPointer); 328 328 }; 329 329 }; … … 334 334 //////////////////// 335 335 //! @brief ExecutorClass, that can execute Functions with one parameter. 336 template<class T, typename CallType, typename ReturnType, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>336 template<class T, typename CallType, typename ReturnType, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 337 337 class __EXECUTOR_FUNCTIONAL_NAME(0,ret) : public Executor<CallType, BaseClass> 338 338 { … … 355 355 * @param eval the CallType to get the Parameters from. 356 356 */ 357 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const357 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 358 358 { 359 359 Evaluater<CallType>::template storeRet<ReturnType>(eval, (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)()); … … 366 366 virtual Executor<CallType, BaseClass>* clone() const 367 367 { 368 return new __EXECUTOR_FUNCTIONAL_NAME(0,ret)<T, CallType, ReturnType >(this->functionPointer);368 return new __EXECUTOR_FUNCTIONAL_NAME(0,ret)<T, CallType, ReturnType, BaseClass>(this->functionPointer); 369 369 }; 370 370 }; … … 374 374 //////////////////// 375 375 //! @brief ExecutorClass, that can execute Functions with one parameter. 376 template<class T, typename CallType, typename ReturnType, typename type0, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>376 template<class T, typename CallType, typename ReturnType, typename type0, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 377 377 class __EXECUTOR_FUNCTIONAL_NAME(1,ret) : public Executor<CallType, BaseClass> 378 378 { … … 395 395 * @param eval the CallType to get the Parameters from. 396 396 */ 397 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const397 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 398 398 { 399 399 Evaluater<CallType>::template storeRet<ReturnType>(eval, (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 407 407 virtual Executor<CallType, BaseClass>* clone() const 408 408 { 409 return new __EXECUTOR_FUNCTIONAL_NAME(1,ret)<T, CallType, ReturnType, type0 >(this->functionPointer);409 return new __EXECUTOR_FUNCTIONAL_NAME(1,ret)<T, CallType, ReturnType, type0, BaseClass>(this->functionPointer); 410 410 }; 411 411 }; … … 416 416 //////////////////// 417 417 //! @brief ExecutorClass, that can execute Functions with one parameter. 418 template<class T, typename CallType, typename ReturnType, typename type0, typename type1, template<typename> class Evaluater = ExecutorEvaluater, class BaseClass = BaseObject>418 template<class T, typename CallType, typename ReturnType, typename type0, typename type1, class BaseClass = BaseObject, template<typename> class Evaluater = ExecutorEvaluater> 419 419 class __EXECUTOR_FUNCTIONAL_NAME(2,ret) : public Executor<CallType, BaseClass> 420 420 { … … 437 437 * @param eval the CallType to get the Parameters from. 438 438 */ 439 virtual void operator()(Base Object* object, CallType& eval = Evaluater<CallType>::defaultValue()) const439 virtual void operator()(BaseClass* object, CallType& eval = Evaluater<CallType>::defaultValue()) const 440 440 { 441 441 Evaluater<CallType>::template storeRet<ReturnType>(eval, (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( … … 450 450 virtual Executor<CallType, BaseClass>* clone() const 451 451 { 452 return new __EXECUTOR_FUNCTIONAL_NAME(2,ret)<T, CallType, ReturnType, type0, type1 >(this->functionPointer);452 return new __EXECUTOR_FUNCTIONAL_NAME(2,ret)<T, CallType, ReturnType, type0, type1, BaseClass>(this->functionPointer); 453 453 }; 454 454 }; -
branches/new_class_id/src/lib/util/executor/functor_generic.h
r9745 r9769 27 27 */ 28 28 #define EXECUTOR_FUNCTIONAL_CREATOR0(CallType) \ 29 template<class T > Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \29 template<class T, class BaseClass> Executor<CallType, BaseClass>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \ 30 30 { \ 31 return new __EXECUTOR_FUNCTIONAL_NAME(0,)<T, CallType >(functionPointer); \31 return new __EXECUTOR_FUNCTIONAL_NAME(0,)<T, CallType, BaseClass>(functionPointer); \ 32 32 } 33 33 … … 38 38 */ 39 39 #define EXECUTOR_FUNCTIONAL_CREATOR1(CallType, type0) \ 40 template<class T > Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \40 template<class T, class BaseClass> Executor<CallType, BaseClass>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \ 41 41 { \ 42 return new __EXECUTOR_FUNCTIONAL_NAME(1,)<T, CallType, type0 >(functionPointer); \42 return new __EXECUTOR_FUNCTIONAL_NAME(1,)<T, CallType, type0, BaseClass>(functionPointer); \ 43 43 } 44 44 … … 50 50 */ 51 51 #define EXECUTOR_FUNCTIONAL_CREATOR2(CallType, type0, type1) \ 52 template<class T > Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \52 template<class T, class BaseClass> Executor<CallType, BaseClass>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \ 53 53 { \ 54 return new __EXECUTOR_FUNCTIONAL_NAME(2,)<T, CallType, type0, type1 >(functionPointer); \54 return new __EXECUTOR_FUNCTIONAL_NAME(2,)<T, CallType, type0, type1, BaseClass>(functionPointer); \ 55 55 } 56 56 … … 63 63 */ 64 64 #define EXECUTOR_FUNCTIONAL_CREATOR3(CallType, type0, type1, type2) \ 65 template<class T > Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \65 template<class T, class BaseClass> Executor<CallType, BaseClass>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \ 66 66 { \ 67 return new __EXECUTOR_FUNCTIONAL_NAME(3,)<T, CallType, type0, type1, type2 >(functionPointer); \67 return new __EXECUTOR_FUNCTIONAL_NAME(3,)<T, CallType, type0, type1, type2, BaseClass>(functionPointer); \ 68 68 } 69 69 … … 77 77 */ 78 78 #define EXECUTOR_FUNCTIONAL_CREATOR4(CallType, type0, type1, type2, type3) \ 79 template<class T > Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \79 template<class T, class BaseClass> Executor<CallType, BaseClass>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \ 80 80 { \ 81 return new __EXECUTOR_FUNCTIONAL_NAME(4,)<T, CallType, type0, type1, type2, type3 >(functionPointer); \81 return new __EXECUTOR_FUNCTIONAL_NAME(4,)<T, CallType, type0, type1, type2, type3, BaseClass>(functionPointer); \ 82 82 } 83 83 … … 92 92 */ 93 93 #define EXECUTOR_FUNCTIONAL_CREATOR5(CallType, type0, type1, type2, type3, type4) \ 94 template<class T > Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \94 template<class T, class BaseClass> Executor<CallType, BaseClass>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \ 95 95 { \ 96 return new __EXECUTOR_FUNCTIONAL_NAME(5,)<T, CallType, type0, type1, type2, type3, type4 >(functionPointer); \96 return new __EXECUTOR_FUNCTIONAL_NAME(5,)<T, CallType, type0, type1, type2, type3, type4, BaseClass>(functionPointer); \ 97 97 } 98 98
Note: See TracChangeset
for help on using the changeset viewer.