Changeset 9869 in orxonox.OLD for trunk/src/lib/shell/shell_command.h
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.h
r8145 r9869 9 9 #include "base_object.h" 10 10 11 #include "executor/executor.h" 11 /// THIS IS USED TO LOAD CONSTANT AND STATIC FUNCTIONS EASILY. 12 #include "executor/executor_substring.h" 13 #include "executor/functor_member.h" 14 #include "executor/functor_const_member.h" 15 #include "executor/functor_static.h" 16 12 17 #include "shell_completion_plugin.h" 13 18 … … 35 40 */ 36 41 #define SHELL_COMMAND(command, class, function) \ 37 OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class >(&class::function))42 OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(&class::function)) 38 43 39 44 /** … … 51 56 */ 52 57 #define SHELL_COMMAND_STATIC(command, class, function) \ 53 OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class >(function))58 OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(function)) 54 59 55 60 … … 58 63 class ShellCommand : public BaseObject 59 64 { 65 ObjectListDeclaration(ShellCommand); 66 60 67 friend class ShellCommandClass; 61 68 public: … … 69 76 ShellCommand* completionPlugin(unsigned int parameter, const CompletorPlugin& completorPlugin); 70 77 71 static ShellCommand* registerCommand(const std::string& commandName, const std::string& className, Executor * executor);78 static ShellCommand* registerCommand(const std::string& commandName, const std::string& className, Executor<const SubString>* executor); 72 79 static void unregisterCommand(const std::string& commandName, const std::string& className); 73 80 static const ShellCommand* const getCommand(const std::string& commandName, const std::string& className); … … 85 92 86 93 protected: 87 ShellCommand(const std::string& commandName, const std::string& className, Executor * executor);94 ShellCommand(const std::string& commandName, const std::string& className, Executor<const SubString>* executor); 88 95 virtual ~ShellCommand(); 89 96 … … 97 104 std::string description; //!< A description for this commnand. (initially ""). Assigned with (create)->describe("blablabla"); 98 105 std::vector<CompletorPlugin*> completors; //!< Completors for the Parameters 99 Executor *executor; //!< The Executor, that really executes the Function.106 Executor<const SubString>* executor; //!< The Executor, that really executes the Function. 100 107 }; 101 108
Note: See TracChangeset
for help on using the changeset viewer.