Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7197 in orxonox.OLD for trunk/src/lib/util/executor/executor.h


Ignore:
Timestamp:
Mar 8, 2006, 2:02:58 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Executor now uses MultiType instead of va_arg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor.h

    r5691 r7197  
    11/*!
    22 * @file executor.h
    3  * Definition of a on-screen-shell
     3 * Definition of an Executor
    44 */
    55
     
    1616#include <stdarg.h>
    1717
    18 // FORWARD DECLARATION
    19 template<class T> class tList;
    20 
    2118//! an enumerator for the definition of the Type.
    2219typedef enum {
     
    3027// BASE CLASS //
    3128////////////////
    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 */
    3340class Executor: public BaseObject
    3441{
     
    5259
    5360  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);
    5666
    5767    void cloning(Executor* executor) const;
    58 
    59 //    const SubString& getSubString(const char* string) const { return SubString(string); };
    6068
    6169  protected:
    6270    long                        functorType;      //!< The type of Function we've got (either static or objective).
    6371    unsigned int                paramCount;       //!< the count of parameters.
    64     MultiType*                  defaultValue;     //!< Default Values.
     72    MultiType                   defaultValue[5];  //!< Default Values.
    6573};
    6674
     
    132140#define ExecutorConstructor1(t1) \
    133141  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE)) \
    134   : Executor(1, t1##_PARAM) \
     142  : Executor(t1##_PARAM) \
    135143  { \
    136144    this->functorType = EXECUTORTYPE; \
     
    141149#define ExecutorConstructor2(t1,t2) \
    142150  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \
    143   : Executor(2, t1##_PARAM, t2##_PARAM) \
     151  : Executor(t1##_PARAM, t2##_PARAM) \
    144152  { \
    145153    this->functorType = EXECUTORTYPE; \
     
    150158#define ExecutorConstructor3(t1,t2,t3) \
    151159  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) \
    153161  { \
    154162    this->functorType = EXECUTORTYPE; \
     
    159167#define ExecutorConstructor4(t1,t2,t3,t4) \
    160168  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) \
    162170  { \
    163171    this->functorType = EXECUTORTYPE; \
     
    168176#define ExecutorConstructor5(t1,t2,t3,t4,t5) \
    169177  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) \
    171179  { \
    172180    this->functorType = EXECUTORTYPE; \
Note: See TracChangeset for help on using the changeset viewer.