Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5641 in orxonox.OLD for trunk/src/lib/shell/shell_command.h


Ignore:
Timestamp:
Nov 18, 2005, 9:22:23 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Passing Reference inastead of Pointer to create ShellCommand

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.h

    r5640 r5641  
    4141//        ShellCommand* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function)
    4242#define SHELL_COMMAND(command, class, function) \
    43            ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, new ExecutorObjective<class>(&class::function))
     43           ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, ExecutorObjective<class>(&class::function))
    4444
    4545/**
     
    5757 */
    5858#define SHELL_COMMAND_STATIC(command, class, function) \
    59            ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, new ExecutorStatic<class>(function))
     59           ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, ExecutorStatic<class>(function))
    6060
    6161
     
    7272    ShellCommand* defaultValues(unsigned int count, ...);
    7373
    74     static ShellCommand* registerCommand(const char* commandName, const char* className, Executor* executor);
     74    static ShellCommand* registerCommand(const char* commandName, const char* className, const Executor& executor);
    7575
    7676    static void unregisterCommand(const char* commandName, const char* className);
     
    7979
    8080  protected:
    81     ShellCommand(const char* commandName, const char* className, Executor* executor);
     81    ShellCommand(const char* commandName, const char* className, const Executor& executor);
    8282    ~ShellCommand();
    8383
    84     static bool isRegistered(const char* commandName, const char* className, Executor* executor);
     84    static bool isRegistered(const char* commandName, const char* className, const Executor& executor);
    8585    static const char* paramToString(long parameter);
    8686
    8787  protected:
    88     void*                            functionPointer;                      //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
    8988    unsigned int                     paramCount;                           //!< the count of parameters.
    9089    unsigned int*                    parameters;                           //!< Parameters the function of this Command takes.
Note: See TracChangeset for help on using the changeset viewer.