Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 16, 2006, 1:38:36 PM (18 years ago)
Author:
bensch
Message:

multiple generic inclusion of Executors, better and nicer interface for include

File:
1 copied

Legend:

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

    r9739 r9740  
    11/*!
    2  * @file executor_functional.h
     2 * @file functor_generic.h
    33 * Definition of an Executor
    44 */
     
    1919*/
    2020
    21 
    22 #ifndef __FUNCTOR_MEMBER_H_
    23 #define __FUNCTOR_MEMBER_H_
    24 
    25 #include "executor_member.h"
    26 #include "substring.h"
    27 
    2821// // // // // // // // // // // // //
    2922//// EXTENSION TO HIDE CONSTRUCT /////
     
    3124/**
    3225 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     26 * @param CallType the Type of Executor to generate
    3327 */
    34 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    35 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
     28#define EXECUTOR_FUNCTIONAL_CREATOR0(CallType) \
     29template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    3630{ \
    37   return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \
     31  return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, CallType>(functionPointer); \
    3832}
    3933
    4034/**
    4135 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     36 * @param CallType the Type of Executor to generate
    4237 * @param type0 for internal usage: the first Argument
    4338 */
    44 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    45 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
     39#define EXECUTOR_FUNCTIONAL_CREATOR1(CallType, type0) \
     40template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
    4641{ \
    47   return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \
     42  return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, CallType, type0>(functionPointer); \
    4843}
    4944
    5045/**
    5146 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     47 * @param CallType the Type of Executor to generate
    5248 * @param type0 for internal usage: the first Argument
    5349 * @param type1 for internal usage: the second Argument
    5450 */
    55 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    56 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
     51#define EXECUTOR_FUNCTIONAL_CREATOR2(CallType, type0, type1) \
     52template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
    5753{ \
    58   return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \
     54  return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, CallType, type0, type1>(functionPointer); \
    5955}
    6056
    6157/**
    6258 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     59 * @param CallType the Type of Executor to generate
    6360 * @param type0 for internal usage: the first Argument
    6461 * @param type1 for internal usage: the second Argument
    6562 * @param type2 for internal usage: the third Argument
    6663 */
    67 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    68 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
     64#define EXECUTOR_FUNCTIONAL_CREATOR3(CallType, type0, type1, type2) \
     65template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
    6966{ \
    70   return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \
     67  return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, CallType, type0, type1, type2>(functionPointer); \
    7168}
    7269
    7370/**
    7471 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     72 * @param CallType the Type of Executor to generate
    7573 * @param type0 for internal usage: the first Argument
    7674 * @param type1 for internal usage: the second Argument
     
    7876 * @param type3 for internal usage: the fourth Argument
    7977 */
    80 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    81 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
     78#define EXECUTOR_FUNCTIONAL_CREATOR4(CallType, type0, type1, type2, type3) \
     79template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
    8280{ \
    83   return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \
     81  return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, CallType, type0, type1, type2, type3>(functionPointer); \
    8482}
    8583
    8684/**
    8785 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     86 * @param CallType the Type of Executor to generate
    8887 * @param type0 for internal usage: the first Argument
    8988 * @param type1 for internal usage: the second Argument
     
    9291 * @param type4 for internal usage: the fifth Argument
    9392 */
    94 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    95 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
     93#define EXECUTOR_FUNCTIONAL_CREATOR5(CallType, type0, type1, type2, type3, type4) \
     94template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
    9695{ \
    97     return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \
     96    return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, CallType, type0, type1, type2, type3, type4>(functionPointer); \
    9897}
    9998
     
    105104#undef FUNCTOR_LIST
    106105
    107 
    108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
Note: See TracChangeset for help on using the changeset viewer.