Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5636 in orxonox.OLD for trunk/src/lib/util


Ignore:
Timestamp:
Nov 18, 2005, 6:55:18 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: adapting ShellCommand to use Executor.
On the go

Location:
trunk/src/lib/util/executor
Files:
2 edited

Legend:

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

    r5635 r5636  
    3838 * @param paramCount the count of parameters this command takes
    3939 */
    40 Executor::Executor(const char* commandName, const char* className, unsigned int paramCount, ...)
     40Executor::Executor(unsigned int paramCount, ...)
    4141{
    4242  this->setClassID(CL_EXECUTOR, "Executor");
    43   this->setName(commandName);
    4443
    45 //  this->classID = classID;
    46   // handling parameters, and storing them:
    4744  if (paramCount > FUNCTOR_MAX_ARGUMENTS)
    4845    paramCount = FUNCTOR_MAX_ARGUMENTS;
  • trunk/src/lib/util/executor/executor.h

    r5635 r5636  
    4141
    4242  protected:
    43     Executor(const char* commandName, const char* className, unsigned int paramCount, ...);
     43    Executor(unsigned int paramCount, ...);
    4444    ~Executor();
    4545
     
    7777// COMMAND REGISTRATION //
    7878//////////////////////////
    79 // EXECUTOR can be redefined as Executor or ExecutorStatic
    80 // EXECUTOREXECUTER can be redefined too.
     79// EXECUTOR             can be redefined as Executor or ExecutorStatic
     80// EXECUTOREXECUTER     can be redefined too.
    8181// EXECUTORINCLASS
    8282// EXECUTORTYPE
     83
    8384
    8485///////////////////////
     
    111112//! creates a command that takes no parameters
    112113#define ExecutorConstructor0() \
    113   EXECUTOR(const char* commandName, const char* className, void EXECUTORINCLASS(*function)()) \
    114   : Executor(commandName, className, 0) \
     114  EXECUTOR(void EXECUTORINCLASS(*function)()) \
     115  : Executor(0) \
    115116  { \
    116117    this->functorType = EXECUTORTYPE; \
     
    120121//! creates a command that takes one parameter
    121122#define ExecutorConstructor1(t1) \
    122   EXECUTOR(const char* commandName, const char* className, void EXECUTORINCLASS(*function)(t1##_TYPE)) \
    123   : Executor(commandName, className, 1, t1##_PARAM) \
     123  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE)) \
     124  : Executor(1, t1##_PARAM) \
    124125  { \
    125126    this->functorType = EXECUTORTYPE; \
     
    129130//! creates a command that takes two parameters
    130131#define ExecutorConstructor2(t1,t2) \
    131   EXECUTOR(const char* commandName, const char* className, void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \
    132   : Executor(commandName, className, 2, t1##_PARAM, t2##_PARAM) \
     132  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \
     133  : Executor(2, t1##_PARAM, t2##_PARAM) \
    133134  { \
    134135    this->functorType = EXECUTORTYPE; \
     
    138139//! creates a command that takes three parameter
    139140#define ExecutorConstructor3(t1,t2,t3) \
    140   EXECUTOR(const char* commandName, const char* className, void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \
    141   : Executor(commandName, className, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM) \
     141  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \
     142  : Executor(3, t1##_PARAM, t2##_PARAM, t3##_PARAM) \
    142143  { \
    143144    this->functorType = EXECUTORTYPE; \
     
    147148//! creates a command that takes four parameter
    148149#define ExecutorConstructor4(t1,t2,t3,t4) \
    149   EXECUTOR(const char* commandName, const char* className, void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \
    150   : Executor(commandName, className, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM) \
     150  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \
     151  : Executor(4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM) \
    151152  { \
    152153    this->functorType = EXECUTORTYPE; \
     
    156157//! creates a command that takes five parameter
    157158#define ExecutorConstructor5(t1,t2,t3,t4,t5) \
    158   EXECUTOR(const char* commandName, const char* className, void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \
    159   : Executor(commandName, className, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM) \
     159  EXECUTOR(void EXECUTORINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \
     160  : Executor(5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM) \
    160161  { \
    161162    this->functorType = EXECUTORTYPE; \
     
    292293
    293294
    294     virtual void executeCommand (BaseObject* object, const char* parameters)
     295    virtual void execute (BaseObject* object, const char* parameters)
    295296    {
    296297  SubString sub(parameters, true);
Note: See TracChangeset for help on using the changeset viewer.