Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7722 in orxonox.OLD for trunk/src/lib/shell


Ignore:
Timestamp:
May 19, 2006, 4:21:01 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Removed the old Executor, and inserted the new one into the ShellCommand

Location:
trunk/src/lib/shell
Files:
2 edited

Legend:

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

    r7456 r7722  
    3636   * @param paramCount the count of parameters this command takes
    3737   */
    38   ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, const Executor& executor)
     38  ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, Executor* executor)
    3939  {
    4040    this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
     
    4343
    4444    // copy the executor:
    45     this->executor = executor.clone();
     45    this->executor = executor;
    4646    this->executor->setName(commandName);
    4747
     
    7575   * @brief registers a new ShellCommand
    7676   */
    77   ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, const Executor& executor)
     77  ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, Executor* executor)
    7878  {
    7979    if (ShellCommand::exists(commandName, className))
    80       return NULL;
     80    {
     81      delete executor;
     82      return NULL;
     83    }
    8184    else
    8285      return new ShellCommand(commandName, className, executor);
  • trunk/src/lib/shell/shell_command.h

    r7418 r7722  
    3737  //        ShellCommand* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function)
    3838#define SHELL_COMMAND(command, class, function) \
    39            OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, ExecutorObjective<class>(&class::function))
     39           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class>(&class::function))
    4040
    4141  /**
     
    5353   */
    5454#define SHELL_COMMAND_STATIC(command, class, function) \
    55            OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, ExecutorStatic<class>(function))
     55           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class>(function))
    5656
    5757
     
    7171    ShellCommand* completionPlugin(unsigned int parameter, const CompletorPlugin& completorPlugin);
    7272
    73     static ShellCommand* registerCommand(const std::string& commandName, const std::string& className, const Executor& executor);
     73    static ShellCommand* registerCommand(const std::string& commandName, const std::string& className, Executor* executor);
    7474    static void unregisterCommand(const std::string& commandName, const std::string& className);
    7575    static const ShellCommand* const getCommand(const std::string& commandName, const std::string& className);
     
    8787
    8888  protected:
    89     ShellCommand(const std::string& commandName, const std::string& className, const Executor& executor);
     89    ShellCommand(const std::string& commandName, const std::string& className, Executor* executor);
    9090    virtual ~ShellCommand();
    9191
Note: See TracChangeset for help on using the changeset viewer.