Changeset 9740 in orxonox.OLD for branches/new_class_id/src
- Timestamp:
- Sep 16, 2006, 1:38:36 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 9 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/shell/shell_command.h
r9728 r9740 9 9 #include "base_object.h" 10 10 11 #include "executor/executor.h"12 13 11 /// THIS IS USED TO LOAD CONSTANT AND STATIC FUNCTIONS EASILY. 14 #include "executor/executor_functional.h" 15 #define EXECUTOR_FUNCTIONAL_USE_CONST 16 #include "executor/executor_functional.h" 17 #define EXECUTOR_FUNCTIONAL_USE_STATIC 18 #include "executor/executor_functional.h" 19 12 #include "executor/functor_member.h" 13 #include "executor/functor_const_member.h" 14 #include "executor/functor_static.h" 20 15 21 16 #include "shell_completion_plugin.h" -
branches/new_class_id/src/lib/util/Makefile.am
r9727 r9740 8 8 libORXexecutor_a_SOURCES = \ 9 9 executor/executor.cc \ 10 executor/executor_functional.cc \11 10 executor/executor_lua.cc 11 12 # executor/executor_functional.cc 12 13 13 14 libORXlibutil_a_SOURCES = \ -
branches/new_class_id/src/lib/util/executor/executor_const_member.h
r9739 r9740 38 38 39 39 /// We want to include __EXECUTOR_GENERIC_H again, with current settings. 40 #ifdef __EXECUTOR_GENERIC_H 41 #undef __EXECUTOR_GENERIC_H 40 42 41 #include "executor_generic.h" 43 42 -
branches/new_class_id/src/lib/util/executor/executor_generic.h
r9737 r9740 20 20 21 21 22 22 23 #ifndef __EXECUTOR_GENERIC_H_ 23 24 #define __EXECUTOR_GENERIC_H_ 25 24 26 25 27 #include "executor.h" … … 105 107 }; 106 108 109 #endif /* __EXECUTOR_GENERIC_H_ */ 110 107 111 108 112 /////////// … … 394 398 }; 395 399 396 #ifndef __EXECUTOR_GENERIC_H_ 400 //#endif /* __EXECUTOR_GENERIC_H_ */ -
branches/new_class_id/src/lib/util/executor/executor_member.h
r9737 r9740 23 23 24 24 /// Define all Constructs, that define an Executor. 25 26 25 //! The Name to be attached to the functional (for normal, static, and const modes) 27 26 #define __EXECUTOR_FUNCTIONAL_NAME(ParamCount) Executor##ParamCount##Params 28 29 27 //! if Functional is constant calling 30 28 #define __EXECUTOR_FUNCTIONAL_CONST … … 34 32 #define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER T::*functionPointer 35 33 //! The Type of Function 36 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE Executor<CallType, BaseClass>::Function Default34 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE Executor<CallType, BaseClass>::FunctionMember 37 35 38 36 39 37 /// We want to include __EXECUTOR_GENERIC_H again, with current settings. 40 #ifdef __EXECUTOR_GENERIC_H41 #undef __EXECUTOR_GENERIC_H42 38 #include "executor_generic.h" 43 39 40 44 41 #undef __EXECUTOR_FUNCTIONAL_NAME 45 46 42 #undef __EXECUTOR_FUNCTIONAL_CONST 47 43 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_EXEC -
branches/new_class_id/src/lib/util/executor/executor_static.h
r9739 r9740 38 38 39 39 /// We want to include __EXECUTOR_GENERIC_H again, with current settings. 40 #ifdef __EXECUTOR_GENERIC_H41 #undef __EXECUTOR_GENERIC_H42 40 #include "executor_generic.h" 43 41 -
branches/new_class_id/src/lib/util/executor/functor_const_member.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_CONST_MEMBER_H_ 23 #define __FUNCTOR_CONST_MEMBER_H_ 24 24 25 #include "executor_ member.h"25 #include "executor_const_member.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_const 34 //! if Functional is constant calling 35 #define __EXECUTOR_FUNCTIONAL_CONST const 36 //! The Function-Pointer, and how to save it internally. 37 #define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER T::*functionPointer 38 //! The Type of Function 39 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE Executor<CallType, BaseClass>::FunctionMember 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 } 41 /// Now we include The generic Functor, that generate the functions. 42 #include "functor_generic.h" 72 43 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 44 #undef __EXECUTOR_FUNCTIONAL_NAME 45 #undef __EXECUTOR_FUNCTIONAL_CONST 46 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER 47 #undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE 106 48 107 49 108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS 50 51 #endif /* __FUNCTOR_CONST_MEMBER_H_ */ -
branches/new_class_id/src/lib/util/executor/functor_generic.h
r9739 r9740 1 1 /*! 2 * @file executor_functional.h2 * @file functor_generic.h 3 3 * Definition of an Executor 4 4 */ … … 19 19 */ 20 20 21 22 #ifndef __FUNCTOR_MEMBER_H_23 #define __FUNCTOR_MEMBER_H_24 25 #include "executor_member.h"26 #include "substring.h"27 28 21 // // // // // // // // // // // // // 29 22 //// EXTENSION TO HIDE CONSTRUCT ///// … … 31 24 /** 32 25 * @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 33 27 */ 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) \ 29 template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \ 36 30 { \ 37 return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \31 return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, CallType>(functionPointer); \ 38 32 } 39 33 40 34 /** 41 35 * @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 42 37 * @param type0 for internal usage: the first Argument 43 38 */ 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) \ 40 template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \ 46 41 { \ 47 return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \42 return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, CallType, type0>(functionPointer); \ 48 43 } 49 44 50 45 /** 51 46 * @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 52 48 * @param type0 for internal usage: the first Argument 53 49 * @param type1 for internal usage: the second Argument 54 50 */ 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) \ 52 template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \ 57 53 { \ 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); \ 59 55 } 60 56 61 57 /** 62 58 * @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 63 60 * @param type0 for internal usage: the first Argument 64 61 * @param type1 for internal usage: the second Argument 65 62 * @param type2 for internal usage: the third Argument 66 63 */ 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) \ 65 template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \ 69 66 { \ 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); \ 71 68 } 72 69 73 70 /** 74 71 * @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 75 73 * @param type0 for internal usage: the first Argument 76 74 * @param type1 for internal usage: the second Argument … … 78 76 * @param type3 for internal usage: the fourth Argument 79 77 */ 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) \ 79 template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \ 82 80 { \ 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); \ 84 82 } 85 83 86 84 /** 87 85 * @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 88 87 * @param type0 for internal usage: the first Argument 89 88 * @param type1 for internal usage: the second Argument … … 92 91 * @param type4 for internal usage: the fifth Argument 93 92 */ 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) \ 94 template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \ 96 95 { \ 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); \ 98 97 } 99 98 … … 105 104 #undef FUNCTOR_LIST 106 105 107 108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS -
branches/new_class_id/src/lib/util/executor/functor_list.h
r9732 r9740 17 17 18 18 #ifdef FUNCTOR_LIST 19 FUNCTOR_LIST(0)( );19 FUNCTOR_LIST(0)(FUNCTOR_CALL_TYPE); 20 20 //! makes functions with one string 21 FUNCTOR_LIST(1)( const std::string&);21 FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, const std::string&); 22 22 //! makes functions with two strings 23 FUNCTOR_LIST(2)( const std::string&, const std::string&);23 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, const std::string&); 24 24 //! makes functions with three strings 25 FUNCTOR_LIST(3)( const std::string&, const std::string&, const std::string&);25 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, const std::string&, const std::string&); 26 26 //! makes functions with four strings 27 FUNCTOR_LIST(4)( const std::string&, const std::string&, const std::string&, const std::string&);27 FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, const std::string&, const std::string&, const std::string&, const std::string&); 28 28 29 29 30 30 //! makes functions with one bool 31 FUNCTOR_LIST(1)( bool);31 FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, bool); 32 32 33 33 //! makes functions with one int 34 FUNCTOR_LIST(1)( int);34 FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, int); 35 35 //! makes functions with two ints 36 FUNCTOR_LIST(2)( int, int);36 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, int, int); 37 37 //! makes functions with three ints 38 FUNCTOR_LIST(3)( int, int, int);38 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, int, int, int); 39 39 //! makes functions with four ints 40 FUNCTOR_LIST(4)( int, int, int, int);40 FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, int, int, int, int); 41 41 42 42 43 43 //! makes functions with one unsigned int 44 FUNCTOR_LIST(1)( unsigned int);44 FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, unsigned int); 45 45 //! makes functions with two unsigned ints 46 FUNCTOR_LIST(2)( unsigned int, unsigned int);46 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, unsigned int, unsigned int); 47 47 //! makes functions with three unsigned ints 48 FUNCTOR_LIST(3)( unsigned int, unsigned int, unsigned int);48 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, unsigned int, unsigned int, unsigned int); 49 49 //! makes functions with four unsigned ints 50 FUNCTOR_LIST(4)( unsigned int, unsigned int, unsigned int, unsigned int);50 FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, unsigned int, unsigned int, unsigned int, unsigned int); 51 51 52 52 //! makes functions with one float 53 FUNCTOR_LIST(1)( float);53 FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, float); 54 54 //! makes functions with two floats 55 FUNCTOR_LIST(2)( float, float);55 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, float, float); 56 56 //! makes functions with three floats 57 FUNCTOR_LIST(3)( float, float, float);57 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, float, float, float); 58 58 //! makes functions with four floats 59 FUNCTOR_LIST(4)( float, float, float, float);59 FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, float, float, float, float); 60 60 //! makes functions with four floats 61 FUNCTOR_LIST(5)( float, float, float, float, float);61 FUNCTOR_LIST(5)(FUNCTOR_CALL_TYPE, float, float, float, float, float); 62 62 63 63 //! mixed values: 64 FUNCTOR_LIST(2)( const std::string&, int);65 FUNCTOR_LIST(2)( const std::string&, float);66 FUNCTOR_LIST(2)( unsigned int, long);67 FUNCTOR_LIST(2)( const std::string&, unsigned int);64 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, int); 65 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, float); 66 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, unsigned int, long); 67 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, unsigned int); 68 68 69 FUNCTOR_LIST(3)( const std::string&, float, unsigned int);70 FUNCTOR_LIST(4)( const std::string&, float, unsigned int, unsigned int);71 FUNCTOR_LIST(3)( const std::string&, int, unsigned int);72 FUNCTOR_LIST(3)( const std::string&, unsigned int, unsigned int);69 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, float, unsigned int); 70 FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, const std::string&, float, unsigned int, unsigned int); 71 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, int, unsigned int); 72 FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, unsigned int, unsigned int); 73 73 74 FUNCTOR_LIST(5)( float, float, float, float, const std::string&);74 FUNCTOR_LIST(5)(FUNCTOR_CALL_TYPE, float, float, float, float, const std::string&); 75 75 76 76 #endif /* FUNCTOR_LIST */ -
branches/new_class_id/src/lib/util/executor/functor_member.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 … … 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 } 60 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 32 //! The Name to be attached to the functional (for normal, static, and const modes) 33 #define __EXECUTOR_FUNCTIONAL_NAME(ParamCount) Executor##ParamCount##Params 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 T::*functionPointer 38 //! The Type of Function 39 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE Executor<CallType, BaseClass>::FunctionMember 106 40 107 41 108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS 42 /// Now we include The generic Functor, that generate the functions. 43 #include "functor_generic.h" 44 45 46 #undef __EXECUTOR_FUNCTIONAL_NAME 47 #undef __EXECUTOR_FUNCTIONAL_CONST 48 #undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER 49 #undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE 50 51 52 53 #endif /* __FUNCTOR_MEMBER_H_ */ -
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_ */ -
branches/new_class_id/src/lib/util/loading/load_param.h
r9728 r9740 24 24 #include "base_object.h" 25 25 26 #include "executor/executor .h"27 #include "executor/ executor_functional.h"26 #include "executor/executor_member.h" 27 #include "executor/functor_member.h" 28 28 29 29 #include "parser/tinyxml/tinyxml.h"
Note: See TracChangeset
for help on using the changeset viewer.