Changeset 7722 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- May 19, 2006, 4:21:01 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7456 r7722 36 36 * @param paramCount the count of parameters this command takes 37 37 */ 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) 39 39 { 40 40 this->setClassID(CL_SHELL_COMMAND, "ShellCommand"); … … 43 43 44 44 // copy the executor: 45 this->executor = executor .clone();45 this->executor = executor; 46 46 this->executor->setName(commandName); 47 47 … … 75 75 * @brief registers a new ShellCommand 76 76 */ 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) 78 78 { 79 79 if (ShellCommand::exists(commandName, className)) 80 return NULL; 80 { 81 delete executor; 82 return NULL; 83 } 81 84 else 82 85 return new ShellCommand(commandName, className, executor); -
trunk/src/lib/shell/shell_command.h
r7418 r7722 37 37 // ShellCommand* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function) 38 38 #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)) 40 40 41 41 /** … … 53 53 */ 54 54 #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)) 56 56 57 57 … … 71 71 ShellCommand* completionPlugin(unsigned int parameter, const CompletorPlugin& completorPlugin); 72 72 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); 74 74 static void unregisterCommand(const std::string& commandName, const std::string& className); 75 75 static const ShellCommand* const getCommand(const std::string& commandName, const std::string& className); … … 87 87 88 88 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); 90 90 virtual ~ShellCommand(); 91 91
Note: See TracChangeset
for help on using the changeset viewer.