Changeset 9740 in orxonox.OLD for branches/new_class_id/src/lib/util/executor/functor_static.h
- Timestamp:
- Sep 16, 2006, 1:38:36 PM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/executor/functor_static.h
r9739 r9740 1 1 /*! 2 * @file executor_functional.h3 * Definition of an Executor2 * @file functor_member.h 3 * Definition of an Functor 4 4 */ 5 5 … … 20 20 21 21 22 #ifndef __FUNCTOR_ MEMBER_H_23 #define __FUNCTOR_ MEMBER_H_22 #ifndef __FUNCTOR_STATIC_H_ 23 #define __FUNCTOR_STATIC_H_ 24 24 25 #include "executor_ member.h"25 #include "executor_static.h" 26 26 #include "substring.h" 27 27 28 // // // // // // // // // // // // // 29 //// EXTENSION TO HIDE CONSTRUCT ///// 30 // // // // // // // // // // // // // 31 /** 32 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 33 */ 34 #define EXECUTOR_FUNCTIONAL_CREATOR0() \ 35 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \ 36 { \ 37 return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \ 38 } 28 #define FUNCTOR_CALL_TYPE const SubString 39 29 40 /** 41 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 42 * @param type0 for internal usage: the first Argument 43 */ 44 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \ 45 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \ 46 { \ 47 return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \ 48 } 30 /// Define all Constructs, that define an Executor. 49 31 50 /** 51 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 52 * @param type0 for internal usage: the first Argument 53 * @param type1 for internal usage: the second Argument 54 */ 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) \ 57 { \ 58 return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \ 59 } 32 //! The Name to be attached to the functional (for normal, static, and const modes) 33 #define __EXECUTOR_FUNCTIONAL_NAME(ParamCount) Executor##ParamCount##Params_static 34 //! if Functional is constant calling 35 #define __EXECUTOR_FUNCTIONAL_CONST 36 //! The Function-Pointer, and how to save it internally. 37 #define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER *functionPointer 38 //! The Type of Function 39 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE Executor<CallType, BaseClass>::FunctionStatic 60 40 61 /** 62 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 63 * @param type0 for internal usage: the first Argument 64 * @param type1 for internal usage: the second Argument 65 * @param type2 for internal usage: the third Argument 66 */ 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) \ 69 { \ 70 return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \ 71 } 72 73 /** 74 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 75 * @param type0 for internal usage: the first Argument 76 * @param type1 for internal usage: the second Argument 77 * @param type2 for internal usage: the third Argument 78 * @param type3 for internal usage: the fourth Argument 79 */ 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) \ 82 { \ 83 return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \ 84 } 85 86 /** 87 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all) 88 * @param type0 for internal usage: the first Argument 89 * @param type1 for internal usage: the second Argument 90 * @param type2 for internal usage: the third Argument 91 * @param type3 for internal usage: the fourth Argument 92 * @param type4 for internal usage: the fifth Argument 93 */ 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) \ 96 { \ 97 return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \ 98 } 99 100 /** 101 * Creates the FunctionCallers imediately 102 */ 103 #define FUNCTOR_LIST(x) EXECUTOR_FUNCTIONAL_CREATOR ## x 104 #include "functor_list.h" 105 #undef FUNCTOR_LIST 41 /// Now we include The generic Functor, that generate the functions. 42 #include "functor_generic.h" 106 43 107 44 108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS 45 #undef __EXECUTOR_FUNCTIONAL_NAME 46 #undef __EXECUTOR_FUNCTIONAL_CONST 47 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER 48 #undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE 49 50 51 52 #endif /* __FUNCTOR_STATIC_H_ */
Note: See TracChangeset
for help on using the changeset viewer.