Changeset 7197 in orxonox.OLD for trunk/src/lib/util/executor/executor.h
- Timestamp:
- Mar 8, 2006, 2:02:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/executor/executor.h
r5691 r7197 1 1 /*! 2 2 * @file executor.h 3 * Definition of a on-screen-shell3 * Definition of an Executor 4 4 */ 5 5 … … 16 16 #include <stdarg.h> 17 17 18 // FORWARD DECLARATION19 template<class T> class tList;20 21 18 //! an enumerator for the definition of the Type. 22 19 typedef enum { … … 30 27 // BASE CLASS // 31 28 //////////////// 32 //! a baseClass for all possible Executors 29 //! a BaseClass for all possible Executors 30 /** 31 * An Executor is an Object, that is able to call Objects of Any type (class) 32 * and execute a function with given parameters on it. 33 * 34 * The Executor is able to handle: 35 * Objects of any Class (Templated) 36 * Default Values 37 * Functions with up to 5 parameters (more seems useless) 38 * Functions with many types (see functor_list.h) 39 */ 33 40 class Executor: public BaseObject 34 41 { … … 52 59 53 60 protected: 54 Executor(); 55 Executor(unsigned int paramCount, ...); 61 Executor(const MultiType& param0 = MT_NULL, 62 const MultiType& param1 = MT_NULL, 63 const MultiType& param2 = MT_NULL, 64 const MultiType& param3 = MT_NULL, 65 const MultiType& param4 = MT_NULL); 56 66 57 67 void cloning(Executor* executor) const; 58 59 // const SubString& getSubString(const char* string) const { return SubString(string); };60 68 61 69 protected: 62 70 long functorType; //!< The type of Function we've got (either static or objective). 63 71 unsigned int paramCount; //!< the count of parameters. 64 MultiType * defaultValue;//!< Default Values.72 MultiType defaultValue[5]; //!< Default Values. 65 73 }; 66 74 … … 132 140 #define ExecutorConstructor1(t1) \ 133 141 EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE)) \ 134 : Executor( 1,t1##_PARAM) \142 : Executor(t1##_PARAM) \ 135 143 { \ 136 144 this->functorType = EXECUTORTYPE; \ … … 141 149 #define ExecutorConstructor2(t1,t2) \ 142 150 EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \ 143 : Executor( 2,t1##_PARAM, t2##_PARAM) \151 : Executor(t1##_PARAM, t2##_PARAM) \ 144 152 { \ 145 153 this->functorType = EXECUTORTYPE; \ … … 150 158 #define ExecutorConstructor3(t1,t2,t3) \ 151 159 EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \ 152 : Executor( 3,t1##_PARAM, t2##_PARAM, t3##_PARAM) \160 : Executor(t1##_PARAM, t2##_PARAM, t3##_PARAM) \ 153 161 { \ 154 162 this->functorType = EXECUTORTYPE; \ … … 159 167 #define ExecutorConstructor4(t1,t2,t3,t4) \ 160 168 EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \ 161 : Executor( 4,t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM) \169 : Executor(t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM) \ 162 170 { \ 163 171 this->functorType = EXECUTORTYPE; \ … … 168 176 #define ExecutorConstructor5(t1,t2,t3,t4,t5) \ 169 177 EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \ 170 : Executor( 5,t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM) \178 : Executor(t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM) \ 171 179 { \ 172 180 this->functorType = EXECUTORTYPE; \
Note: See TracChangeset
for help on using the changeset viewer.