8 #ifndef SRC_COMMANDDISPATCHER_H_ 9 #define SRC_COMMANDDISPATCHER_H_ 82 template <
typename ExtCommand,
typename... Args>
120 std::map<std::string,Command*> m_registry;
121 std::map<std::string,Command*> m_aliasRegistry;
void registerCommand(Command *cmd)
Registers a given Command with this CommandDispatcher instance.
Definition: CommandDispatcher.cpp:23
Command * unregisterCommand(const std::string &name)
Removes the command with the given name from the registry, and removes any of its registered aliases...
Class to register and execute Commands in an iash shell.
Definition: CommandDispatcher.h:30
int dispatch(const UserCommand *userCmd)
Searches the command and alias registries and calls the appropriate Command.
Definition: CommandDispatcher.cpp:77
The main shell class for iash.
Definition: iash.h:56
void registerCommand(Args &&... args)
Registers the given Command type with this CommandDispatcher instance.
Definition: CommandDispatcher.h:83
Abstract interface for a command registered with the shell.
Definition: Command.h:56
Used to retain command arguments and the proper input and output streams for a command call...
Definition: UserCommand.h:28
CommandDispatcher(iash *parent)
Initializes a CommandDispatcher with the given shell parent.
Definition: CommandDispatcher.cpp:16