Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 18, 2005, 9:22:23 PM (18 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.cc

    r5640 r5641  
    3636 * @param paramCount the count of parameters this command takes
    3737 */
    38 ShellCommand::ShellCommand(const char* commandName, const char* className, Executor* executor)
     38ShellCommand::ShellCommand(const char* commandName, const char* className, const Executor& executor)
    3939{
    4040  this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
     
    5454  this->defaultValue = new MultiType[paramCount];
    5555
    56   this->executor = executor;
     56  this->executor = executor.clone();
    5757}
    5858
     
    6969    delete this->alias;
    7070  }
     71  delete this->executor;
    7172}
    7273
     
    7475 * registers a new ShellCommand
    7576 */
    76 ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, Executor* executor)
     77ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, const Executor& executor)
    7778{
    7879  if (ShellCommand::isRegistered(commandName, className, executor))
     
    132133 * This is checked in the registerCommand-function.
    133134 */
    134 bool ShellCommand::isRegistered(const char* commandName, const char* className, Executor* executor)
     135bool ShellCommand::isRegistered(const char* commandName, const char* className, const Executor& executor)
    135136{
    136137  if (ShellCommandClass::commandClassList == NULL)
Note: See TracChangeset for help on using the changeset viewer.