#include <PLearnCommandRegistry.h>
Public Member Functions | |
PLearnCommandRegistry (PLearnCommand *plcommand) | |
This constructor will simply register the given PLearnCommand. | |
Static Public Member Functions | |
void | do_register (PLearnCommand *command) |
registers a command | |
bool | is_registered (const string &commandname) |
checks wether a command is registered with that name | |
void | print_command_summary (ostream &out) |
prints a list of all commands with their one-line summary | |
void | run (const string &commandname, const vector< string > &args) |
run the given (registered) command with the given arguments | |
void | help (const string &commandname, ostream &out) |
prints out detailed help for the given command on the given stream | |
Protected Types | |
typedef map< string, PLearnCommand * > | command_map |
Static Protected Member Functions | |
command_map & | commands () |
Returns a reference to the unique command map. | |
void | badcommand (const string &commandname) |
Issues a "bad command" message. |
|
Definition at line 54 of file PLearnCommandRegistry.h. Referenced by commands(). |
|
This constructor will simply register the given PLearnCommand.
Definition at line 81 of file PLearnCommandRegistry.h. |
|
Issues a "bad command" message.
Definition at line 73 of file PLearnCommandRegistry.cc. References PLearn::endl(), and print_command_summary(). |
|
Returns a reference to the unique command map.
Definition at line 47 of file PLearnCommandRegistry.cc. References command_map. Referenced by do_register(), help(), is_registered(), print_command_summary(), and run(). |
|
registers a command
Definition at line 54 of file PLearnCommandRegistry.cc. References commands(), and PLearn::PLearnCommand::name. |
|
prints out detailed help for the given command on the given stream
Definition at line 90 of file PLearnCommandRegistry.cc. References badcommand(), commands(), and PLearn::endl(). |
|
checks wether a command is registered with that name
Definition at line 57 of file PLearnCommandRegistry.cc. References commands(). |
|
prints a list of all commands with their one-line summary
Definition at line 60 of file PLearnCommandRegistry.cc. References commands(), and PLearn::endl(). Referenced by badcommand(). |
|
run the given (registered) command with the given arguments
Definition at line 81 of file PLearnCommandRegistry.cc. References badcommand(), and commands(). |