Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5151 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Aug 27, 2005, 12:59:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: default Values are passed along

Location:
trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/shell.cc

    r5149 r5151  
    8080  ShellCommand<Shell>::registerCommand("clear", CL_SHELL, &Shell::clear);
    8181  ShellCommand<Shell>::registerCommand("testS", CL_SHELL, &Shell::testS);
    82   ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI);
     82  ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI, 5);
    8383}
    8484
  • trunk/src/util/shell_command.h

    r5150 r5151  
    2626// MACRO DEFINITIONS //
    2727///////////////////////
     28#define   l_BOOL_DEFGRAB(i)         this->defaultBools[i]
     29#define   l_INT_DEFGRAB(i)          this->defaultInts[i]
     30#define   l_UINT_DEFGRAB(i)         (unsigned int)this->defaultInts[i]
     31#define   l_LONG_DEFGRAB(i)         (long)this->defaultInts[i]
     32#define   l_FLOAT_DEFGRAB(i)        this->defaultFloats[i]
     33#define   l_STRING_DEFGRAB(i)       this->defaultStrings[i]
    2834
    2935// COMMAND REGISTRATION
     
    7076#define ShellCommandExecute1(t1) \
    7177   else if (this->paramCount == 1 && this->parameters[0] == t1##_PARAM) \
    72     (dynamic_cast<T*>(object)->*functionPointer_1_##t1)(t1##_FUNC(parameters, 0))
     78    (dynamic_cast<T*>(object)->*functionPointer_1_##t1)(t1##_FUNC(parameters, t1##_DEFGRAB(0)))
    7379
    7480
     
    101107    unsigned int*                    parameters;          //!< Parameters
    102108    bool                             isSingleton;         //!< if the Class is Singleton @todo autocheck
     109    char*                            defaultStrings[FUNCTOR_MAX_ARGUMENTS];
     110    int                              defaultInts[FUNCTOR_MAX_ARGUMENTS];
     111    float                            defaultFloats[FUNCTOR_MAX_ARGUMENTS];
     112    bool                             defaultBools[FUNCTOR_MAX_ARGUMENTS];
    103113
    104114  private:
     
    106116    const char*                      className;           //!< The Name of the Class associated to this Command
    107117
    108     char*                            defaultStrings[FUNCTOR_MAX_ARGUMENTS];
    109     int                              defaultInts[FUNCTOR_MAX_ARGUMENTS];
    110     float                            defaultFloats[FUNCTOR_MAX_ARGUMENTS];
    111     bool                             defaultBools[FUNCTOR_MAX_ARGUMENTS];
    112 
    113 
    114118    // STATIC MEMBERS
    115119    static tList<ShellCommandBase>*  commandList;         //!< A list of availiable commands.
    116120};
    117 
    118 template<class T> class ShellCommand;
    119 /*
    120 template<class T> class ShellCommandSingleton : public ShellCommandBase
    121 {
    122   friend class ShellCommand<T>;
    123   private:
    124     ShellCommandSingleton(const char* commandName, ClassID classID, void (T::*functionPointer)())
    125     : ShellCommandBase (commandName, classID, 0)
    126     {
    127       this->functionPointer_NULL = functionPointer;
    128     }
    129     void (T::*functionPointer_NULL)();
    130 
    131     virtual void executeCommand (const char* parameters)
    132     {
    133       if (this->paramCount == 0)
    134         (T::getInstance()->*functionPointer_NULL)();
    135     }
    136 };*/
    137 
    138121
    139122//! keeps information about a ShellCommand
Note: See TracChangeset for help on using the changeset viewer.