Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2006, 11:10:17 PM (18 years ago)
Author:
bensch
Message:

trunk: prepare for the new Executor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor_functional.h

    r8035 r8048  
    123123
    124124  /** 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) const
     125  virtual void operator()(BaseObject* object, unsigned int count, void* values) const
    126126  {
    127127    (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)();
     
    163163
    164164  /** 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;
    167168    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]) );
    169170  }
    170171
     
    226227
    227228  /** 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;
    230232    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]) );
    233235  }
    234236
     
    280282
    281283  /** 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;
    284287    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]) );
    288291  }
    289292
     
    337340
    338341  /** 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;
    341345    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]) );
    346350  }
    347351
     
    396400
    397401  /** 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;
    400405    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]) );
    406411  }
    407412
     
    421426 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    422427 */
    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() \
     429template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    425430{ \
    426431  return new __EXECUTOR_FUNCTIONAL_NAME(0)<T>(functionPointer); \
     
    431436 * @param type0 for internal usage: the first Argument
    432437 */
    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) \
     439template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    435440{ \
    436441  return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, type0##_TYPE>(functionPointer); \
     
    442447 * @param type1 for internal usage: the second Argument
    443448 */
    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) \
     450template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    446451{ \
    447452  return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, type0##_TYPE, type1##_TYPE>(functionPointer); \
     
    454459 * @param type2 for internal usage: the third Argument
    455460 */
    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) \
     462template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    458463{ \
    459464  return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE>(functionPointer); \
     
    467472 * @param type3 for internal usage: the fourth Argument
    468473 */
    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) \
     475template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    471476{ \
    472477  return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE>(functionPointer); \
     
    481486 * @param type4 for internal usage: the fifth Argument
    482487 */
    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) \
     489template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    485490{ \
    486491    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.