Changeset 8048 in orxonox.OLD for trunk/src/lib/util/executor/executor_functional.h
- Timestamp:
- May 31, 2006, 11:10:17 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/executor/executor_functional.h
r8035 r8048 123 123 124 124 /** executes a Command. @param objec the Object, @param count how many values, @param values the Values */ 125 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const125 virtual void operator()(BaseObject* object, unsigned int count, void* values) const 126 126 { 127 127 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(); … … 163 163 164 164 /** executes a Command. @param objec the Object, @param count how many values, @param values the Values */ 165 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 166 { 165 virtual void operator()(BaseObject* object, unsigned int count, void* values) const 166 { 167 const MultiType* mt = (const MultiType*)values; 167 168 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 168 fromMulti<type0>((count > 0)? values[0] : this->defaultValue[0]) );169 fromMulti<type0>((count > 0)? mt[0] : this->defaultValue[0]) ); 169 170 } 170 171 … … 226 227 227 228 /** executes a Command. @param objec the Object, @param count how many values, @param values the Values */ 228 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 229 { 229 virtual void operator()(BaseObject* object, unsigned int count, void* values) const 230 { 231 const MultiType* mt = (const MultiType*)values; 230 232 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 231 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]),232 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]) );233 fromMulti<type0>((count > 0) ? mt[0] : this->defaultValue[0]), 234 fromMulti<type1>((count > 1) ? mt[1] : this->defaultValue[1]) ); 233 235 } 234 236 … … 280 282 281 283 /** executes a Command. @param objec the Object, @param count how many values, @param values the Values */ 282 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 283 { 284 virtual void operator()(BaseObject* object, unsigned int count, void* values) const 285 { 286 const MultiType* mt = (const MultiType*)values; 284 287 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 285 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]),286 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]),287 fromMulti<type2>((count > 2) ? values[2] : this->defaultValue[2]) );288 fromMulti<type0>((count > 0) ? mt[0] : this->defaultValue[0]), 289 fromMulti<type1>((count > 1) ? mt[1] : this->defaultValue[1]), 290 fromMulti<type2>((count > 2) ? mt[2] : this->defaultValue[2]) ); 288 291 } 289 292 … … 337 340 338 341 /** executes a Command. @param objec the Object, @param count how many values, @param values the Values */ 339 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 340 { 342 virtual void operator()(BaseObject* object, unsigned int count, void* values) const 343 { 344 const MultiType* mt = (const MultiType*)values; 341 345 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 342 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]),343 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]),344 fromMulti<type2>((count > 2) ? values[2] : this->defaultValue[2]),345 fromMulti<type3>((count > 3) ? values[3] : this->defaultValue[3]) );346 fromMulti<type0>((count > 0) ? mt[0] : this->defaultValue[0]), 347 fromMulti<type1>((count > 1) ? mt[1] : this->defaultValue[1]), 348 fromMulti<type2>((count > 2) ? mt[2] : this->defaultValue[2]), 349 fromMulti<type3>((count > 3) ? mt[3] : this->defaultValue[3]) ); 346 350 } 347 351 … … 396 400 397 401 /** executes a Command. @param objec the Object, @param count how many values, @param values the Values */ 398 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 399 { 402 virtual void operator()(BaseObject* object, unsigned int count, void* values) const 403 { 404 const MultiType* mt = (const MultiType*)values; 400 405 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 401 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]),402 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]),403 fromMulti<type2>((count > 2) ? values[2] : this->defaultValue[2]),404 fromMulti<type3>((count > 3) ? values[3] : this->defaultValue[3]),405 fromMulti<type4>((count > 4) ? values[4] : this->defaultValue[4]) );406 fromMulti<type0>((count > 0) ? mt[0] : this->defaultValue[0]), 407 fromMulti<type1>((count > 1) ? mt[1] : this->defaultValue[1]), 408 fromMulti<type2>((count > 2) ? mt[2] : this->defaultValue[2]), 409 fromMulti<type3>((count > 3) ? mt[3] : this->defaultValue[3]), 410 fromMulti<type4>((count > 4) ? mt[4] : this->defaultValue[4]) ); 406 411 } 407 412 … … 421 426 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 422 427 */ 423 #define EXECUTOR_FUNCTIONAL_CREATOR0( ret) \424 template<class T> Executor* createExecutor( ret(__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \428 #define EXECUTOR_FUNCTIONAL_CREATOR0() \ 429 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \ 425 430 { \ 426 431 return new __EXECUTOR_FUNCTIONAL_NAME(0)<T>(functionPointer); \ … … 431 436 * @param type0 for internal usage: the first Argument 432 437 */ 433 #define EXECUTOR_FUNCTIONAL_CREATOR1( ret,type0) \434 template<class T> Executor* createExecutor( ret(__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \438 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \ 439 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \ 435 440 { \ 436 441 return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, type0##_TYPE>(functionPointer); \ … … 442 447 * @param type1 for internal usage: the second Argument 443 448 */ 444 #define EXECUTOR_FUNCTIONAL_CREATOR2( ret,type0, type1) \445 template<class T> Executor* createExecutor( ret(__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \449 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \ 450 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \ 446 451 { \ 447 452 return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, type0##_TYPE, type1##_TYPE>(functionPointer); \ … … 454 459 * @param type2 for internal usage: the third Argument 455 460 */ 456 #define EXECUTOR_FUNCTIONAL_CREATOR3( ret,type0, type1, type2) \457 template<class T> Executor* createExecutor( ret(__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \461 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \ 462 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \ 458 463 { \ 459 464 return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE>(functionPointer); \ … … 467 472 * @param type3 for internal usage: the fourth Argument 468 473 */ 469 #define EXECUTOR_FUNCTIONAL_CREATOR4( ret,type0, type1, type2, type3) \470 template<class T> Executor* createExecutor( ret(__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \474 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \ 475 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \ 471 476 { \ 472 477 return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE>(functionPointer); \ … … 481 486 * @param type4 for internal usage: the fifth Argument 482 487 */ 483 #define EXECUTOR_FUNCTIONAL_CREATOR5( ret,type0, type1, type2, type3, type4) \484 template<class T> Executor* createExecutor( ret(__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \488 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \ 489 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \ 485 490 { \ 486 491 return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE>(functionPointer); \
Note: See TracChangeset
for help on using the changeset viewer.