Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8033 in orxonox.OLD


Ignore:
Timestamp:
May 31, 2006, 4:18:13 PM (18 years ago)
Author:
bensch
Message:

orxonox/gui: executor-with return-type Stage 1

Location:
branches/gui/src/lib/util/executor
Files:
2 edited

Legend:

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

    r7994 r8033  
    421421 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    422422 */
    423 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    424 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
     423#define EXECUTOR_FUNCTIONAL_CREATOR0(ret) \
     424template<class T> Executor* createExecutor(ret (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    425425{ \
    426426  return new __EXECUTOR_FUNCTIONAL_NAME(0)<T>(functionPointer); \
     
    431431 * @param type0 for internal usage: the first Argument
    432432 */
    433 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    434 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     433#define EXECUTOR_FUNCTIONAL_CREATOR1(ret, type0) \
     434template<class T> Executor* createExecutor(ret (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    435435{ \
    436436  return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, type0##_TYPE>(functionPointer); \
     
    442442 * @param type1 for internal usage: the second Argument
    443443 */
    444 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    445 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     444#define EXECUTOR_FUNCTIONAL_CREATOR2(ret, type0, type1) \
     445template<class T> Executor* createExecutor(ret (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    446446{ \
    447447  return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, type0##_TYPE, type1##_TYPE>(functionPointer); \
     
    454454 * @param type2 for internal usage: the third Argument
    455455 */
    456 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    457 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     456#define EXECUTOR_FUNCTIONAL_CREATOR3(ret, type0, type1, type2) \
     457template<class T> Executor* createExecutor(ret (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    458458{ \
    459459  return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE>(functionPointer); \
     
    467467 * @param type3 for internal usage: the fourth Argument
    468468 */
    469 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    470 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     469#define EXECUTOR_FUNCTIONAL_CREATOR4(ret, type0, type1, type2, type3) \
     470template<class T> Executor* createExecutor(ret (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    471471{ \
    472472  return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE>(functionPointer); \
     
    481481 * @param type4 for internal usage: the fifth Argument
    482482 */
    483 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    484 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     483#define EXECUTOR_FUNCTIONAL_CREATOR5(ret, type0, type1, type2, type3, type4) \
     484template<class T> Executor* createExecutor(ret (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    485485{ \
    486486    return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE>(functionPointer); \
  • branches/gui/src/lib/util/executor/functor_list.h

    r7785 r8033  
    9090#ifdef FUNCTOR_LIST
    9191
    92   FUNCTOR_LIST(0)();
     92  FUNCTOR_LIST(0)(void);
    9393  //! makes functions with one string
    94   FUNCTOR_LIST(1)(l_STRING);
     94  FUNCTOR_LIST(1)(void, l_STRING);
    9595  //! makes functions with two strings
    96   FUNCTOR_LIST(2)(l_STRING, l_STRING);
     96  FUNCTOR_LIST(2)(void, l_STRING, l_STRING);
    9797  //! makes functions with three strings
    98   FUNCTOR_LIST(3)(l_STRING, l_STRING, l_STRING);
     98  FUNCTOR_LIST(3)(void, l_STRING, l_STRING, l_STRING);
    9999  //! makes functions with four strings
    100   FUNCTOR_LIST(4)(l_STRING, l_STRING, l_STRING, l_STRING);
     100  FUNCTOR_LIST(4)(void, l_STRING, l_STRING, l_STRING, l_STRING);
    101101
    102102
    103103  //! makes functions with one bool
    104   FUNCTOR_LIST(1)(l_BOOL);
     104  FUNCTOR_LIST(1)(void, l_BOOL);
    105105
    106106  //! makes functions with one int
    107   FUNCTOR_LIST(1)(l_INT);
     107  FUNCTOR_LIST(1)(void, l_INT);
    108108  //! makes functions with two ints
    109   FUNCTOR_LIST(2)(l_INT, l_INT);
     109  FUNCTOR_LIST(2)(void, l_INT, l_INT);
    110110  //! makes functions with three ints
    111   FUNCTOR_LIST(3)(l_INT, l_INT, l_INT);
     111  FUNCTOR_LIST(3)(void, l_INT, l_INT, l_INT);
    112112  //! makes functions with four ints
    113   FUNCTOR_LIST(4)(l_INT, l_INT, l_INT, l_INT);
     113  FUNCTOR_LIST(4)(void, l_INT, l_INT, l_INT, l_INT);
    114114
    115115
    116116  //! makes functions with one unsigned int
    117   FUNCTOR_LIST(1)(l_UINT);
     117  FUNCTOR_LIST(1)(void, l_UINT);
    118118  //! makes functions with two unsigned ints
    119   FUNCTOR_LIST(2)(l_UINT, l_UINT);
     119  FUNCTOR_LIST(2)(void, l_UINT, l_UINT);
    120120  //! makes functions with three unsigned ints
    121   FUNCTOR_LIST(3)(l_UINT, l_UINT, l_UINT);
     121  FUNCTOR_LIST(3)(void, l_UINT, l_UINT, l_UINT);
    122122  //! makes functions with four unsigned ints
    123   FUNCTOR_LIST(4)(l_UINT, l_UINT, l_UINT, l_UINT);
     123  FUNCTOR_LIST(4)(void, l_UINT, l_UINT, l_UINT, l_UINT);
    124124
    125125  //! makes functions with one float
    126   FUNCTOR_LIST(1)(l_FLOAT);
     126  FUNCTOR_LIST(1)(void, l_FLOAT);
    127127  //! makes functions with two floats
    128   FUNCTOR_LIST(2)(l_FLOAT, l_FLOAT);
     128  FUNCTOR_LIST(2)(void, l_FLOAT, l_FLOAT);
    129129  //! makes functions with three floats
    130   FUNCTOR_LIST(3)(l_FLOAT, l_FLOAT, l_FLOAT);
     130  FUNCTOR_LIST(3)(void, l_FLOAT, l_FLOAT, l_FLOAT);
    131131  //! makes functions with four floats
    132   FUNCTOR_LIST(4)(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
     132  FUNCTOR_LIST(4)(void, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
    133133  //! makes functions with four floats
    134   FUNCTOR_LIST(5)(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
     134  FUNCTOR_LIST(5)(void, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
    135135
    136136  //! mixed values:
    137   FUNCTOR_LIST(2)(l_STRING, l_FLOAT);
    138   FUNCTOR_LIST(2)(l_UINT, l_LONG);
    139   FUNCTOR_LIST(2)(l_STRING, l_UINT);
     137  FUNCTOR_LIST(2)(void, l_STRING, l_FLOAT);
     138  FUNCTOR_LIST(2)(void, l_UINT, l_LONG);
     139  FUNCTOR_LIST(2)(void, l_STRING, l_UINT);
    140140
    141   FUNCTOR_LIST(3)(l_STRING, l_FLOAT, l_UINT);
    142   FUNCTOR_LIST(4)(l_STRING, l_FLOAT, l_UINT, l_UINT);
    143   FUNCTOR_LIST(3)(l_STRING, l_INT, l_UINT);
    144   FUNCTOR_LIST(3)(l_STRING, l_UINT, l_UINT);
     141  FUNCTOR_LIST(3)(void, l_STRING, l_FLOAT, l_UINT);
     142  FUNCTOR_LIST(4)(void, l_STRING, l_FLOAT, l_UINT, l_UINT);
     143  FUNCTOR_LIST(3)(void, l_STRING, l_INT, l_UINT);
     144  FUNCTOR_LIST(3)(void, l_STRING, l_UINT, l_UINT);
    145145
    146146#endif /* FUNCTOR_LIST */
Note: See TracChangeset for help on using the changeset viewer.