Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 16, 2006, 12:39:23 PM (18 years ago)
Author:
bensch
Message:

split it up

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/executor/executor_generic.h

    r9736 r9737  
    11/*!
    2  * @file executor_functional.h
    3  * Definition of an Executor
     2 * @file executor_generic.h
     3 * Definition of a Generic Executor
    44 */
    55
     
    2020
    2121
    22 #ifndef __EXECUTOR_FUNCTIONAL_H_
    23 #define __EXECUTOR_FUNCTIONAL_H_
     22#ifndef __EXECUTOR_GENERIC_H_
     23#define __EXECUTOR_GENERIC_H_
    2424
    2525#include "executor.h"
     
    106106
    107107
    108 
    109 
    110 #endif /* __EXECUTOR_FUNCTIONAL_H_ */
    111 
    112 //! if Functional is constant calling
    113 #define __EXECUTOR_FUNCTIONAL_CONST
    114 //! The Name to be attached to the functional (for normal, static, and const modes)
    115 #define __EXECUTOR_FUNCTIONAL_NAME(ParamCount)   Executor##ParamCount##Params
    116 //! The Execution-mode (either static or objective)
    117 #define __EXECUTOR_FUNCTIONAL_FUNCTION_EXEC      dynamic_cast<T*>(object)->*(functionPointer)
    118 //! The Function-Pointer, and how to save it internally.
    119 #define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER   T::*functionPointer
    120 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionDefault
    121 
    122 #ifdef EXECUTOR_FUNCTIONAL_USE_CONST            //! USING CONST FUNCTIONALS
    123  #ifdef __EXECUTOR_FUNCTIONAL_CONST_INCLUDED    //!< CHECK IF ALREADY INCLUED CONST FUNCTIONALS
    124   #define __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
    125  #else
    126   #define __EXECUTOR_FUNCTIONAL_CONST_INCLUDED
    127  #endif
    128  #undef __EXECUTOR_FUNCTIONAL_CONST
    129  #define __EXECUTOR_FUNCTIONAL_CONST const
    130  #undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE
    131  #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionConst
    132  #undef __EXECUTOR_FUNCTIONAL_NAME
    133  #define __EXECUTOR_FUNCTIONAL_NAME(ParamCount) Executor##ParamCount##Params_const
    134 //#endif /* EXECUTOR_FUNCTIONAL_USE_CONST */
    135 
    136 #elif defined EXECUTOR_FUNCTIONAL_USE_STATIC
    137  #ifdef EXECUTOR_FUNCTIONAL_USE_CONST
    138   #error you obviously do not know what you are doing !! ask the bensch
    139  #endif
    140 
    141 #ifdef __EXECUTOR_FUNCTIONAL_STATIC_INCLUDED
    142    #define __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
    143   #else
    144    #define __EXECUTOR_FUNCTIONAL_STATIC_INCLUDED
    145   #endif
    146 
    147 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_EXEC
    148  #define __EXECUTOR_FUNCTIONAL_FUNCTION_EXEC       functionPointer
    149  #undef __EXECUTOR_FUNCTIONAL_NAME
    150  #define __EXECUTOR_FUNCTIONAL_NAME(ParamCount)    Executor##ParamCount##Params_static
    151  #undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER
    152  #define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER    *functionPointer
    153  #undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE
    154  #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionStatic
    155 
    156 //#endif /* EXECUTOR_FUNCTIONAL_USE_STATIC */
    157 #else
    158  #ifdef __EXECUTOR_FUNCTIONAL_PLAIN_INCLUDED
    159   #define __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
    160  #else
    161   #define __EXECUTOR_FUNCTIONAL_PLAIN_INCLUDED
    162  #endif
    163 #endif
    164 
    165 #ifndef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
    166 
    167 
    168 
    169 
    170108///////////
    171109//// 0 ////
     
    456394};
    457395
    458 
    459 
    460 
    461 
    462 
    463 
    464 
    465 
    466 // // // // // // // // // // // // //
    467 //// EXTENSION TO HIDE CONSTRUCT /////
    468 // // // // // // // // // // // // //
    469 /**
    470  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    471  */
    472 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    473 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    474 { \
    475   return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \
    476 }
    477 
    478 /**
    479  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    480  * @param type0 for internal usage: the first Argument
    481  */
    482 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    483 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
    484 { \
    485   return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \
    486 }
    487 
    488 /**
    489  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    490  * @param type0 for internal usage: the first Argument
    491  * @param type1 for internal usage: the second Argument
    492  */
    493 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    494 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
    495 { \
    496   return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \
    497 }
    498 
    499 /**
    500  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    501  * @param type0 for internal usage: the first Argument
    502  * @param type1 for internal usage: the second Argument
    503  * @param type2 for internal usage: the third Argument
    504  */
    505 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    506 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
    507 { \
    508   return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \
    509 }
    510 
    511 /**
    512  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    513  * @param type0 for internal usage: the first Argument
    514  * @param type1 for internal usage: the second Argument
    515  * @param type2 for internal usage: the third Argument
    516  * @param type3 for internal usage: the fourth Argument
    517  */
    518 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    519 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
    520 { \
    521   return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \
    522 }
    523 
    524 /**
    525  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    526  * @param type0 for internal usage: the first Argument
    527  * @param type1 for internal usage: the second Argument
    528  * @param type2 for internal usage: the third Argument
    529  * @param type3 for internal usage: the fourth Argument
    530  * @param type4 for internal usage: the fifth Argument
    531  */
    532 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    533 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
    534 { \
    535     return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \
    536 }
    537 
    538 
    539 /**
    540  * Creates the FunctionCallers
    541  */
    542 #define FUNCTOR_LIST(x) EXECUTOR_FUNCTIONAL_CREATOR ## x
    543 #include "functor_list.h"
    544 #undef FUNCTOR_LIST
    545 
    546 
    547 
    548 #undef __EXECUTOR_FUNCTIONAL_CONST
    549 #undef __EXECUTOR_FUNCTIONAL_NAME
    550 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_EXEC
    551 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER
    552 #undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE
    553 
    554 #ifdef EXECUTOR_FUNCTIONAL_USE_CONST
    555  #undef EXECUTOR_FUNCTIONAL_USE_CONST
    556 #endif
    557 #ifdef EXECUTOR_FUNCTIONAL_USE_STATIC
    558  #undef EXECUTOR_FUNCTIONAL_USE_STATIC
    559 #endif
    560 
    561 
    562 #endif /* __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS */
    563 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
     396#ifndef __EXECUTOR_GENERIC_H_
Note: See TracChangeset for help on using the changeset viewer.