Critical Link MityCam SoC Firmware
1.0
Critical Link MityCam SoC Firmware
|
#include <tcCommandExecutiveBase.h>
Classes | |
struct | tsCmndFunc |
Public Member Functions | |
tcCommandExecutiveBase (const char *appname) | |
Constructor, Create an input thread and then populate the menu and the help menu. More... | |
void | start () |
Protected Types | |
typedef void(* | tpVoidFunc) (void *) |
Protected Member Functions | |
void | add_cmnd (const char *cmnd, tpVoidFunc func, const char *desc) |
void | add_seperator () |
MENU_FUNCTION_DECL (process_help) | |
void | conditionalRead (unsigned int anTabs, const char *apMessage) |
bool | ask_on_off (const char *prompt, bool allowempty=false, bool dflt=false) |
Generic "on/off" asker. More... | |
bool | ask_yes_no (const char *prompt, bool allowempty=false, bool dflt=false) |
Generic "yes/no" asker. More... | |
double | ask_double (const char *prompt, bool allowempty=false, double dflt=0) |
float | ask_float (const char *prompt, bool allowempty=false, float dflt=0) |
uint32_t | ask_uint (const char *prompt, bool allowempty=false, uint32_t dflt=0) |
int32_t | ask_int (const char *prompt, bool allowempty=false, int32_t dflt=0) |
std::string | ask_string (const char *prompt, bool allowempty=false, const char *dflt="") |
void | ReadUserInput () |
void | UserInputLoop () |
tpVoidFunc | get_func (const char *cmnd) |
tsCmndFunc * | get_cmndfunc (const char *cmnd) |
void | printHelp (const char *cmnd) |
Prints either a single command, all commands, or an error, depending on the help string. More... | |
void | printHelpGeneric (const tsCmndFunc *tcf) const |
Prints generic formatted help for the specfied command and info. More... | |
void | printHelpAll () const |
Protected Attributes | |
std::vector< tsCmndFunc > | m_cmnd_func_list |
tcUIThread * | m_ConsoleListenerThread |
Thread handle for User Input. More... | |
bool | m_continue |
Tells the UI thread when QUIT command has been given. More... | |
std::list< std::string > | m_cmnd_list |
std::string | m_appname |
Friends | |
class | tcUIThread |
This class forms the basis of ARM input operations, allowing the programmer to easily write a generic set of commands which will be performed as guided by a parent tpVoidFunc container method. By initializing the command map to translate the desired command into this function call, the new parent tpVoidFunc will automatically be called within the input thread when the user types the corresponding command. Please note that this map will NOT automatically generate the Help Menu in any way, and therefore the programmer must add the command and its description to the corresponding HelpMap. As a final note, to those unfamiliar with the standard map: this is a tree-based container, and string comparisons are based on an integral translation of each string. In other words, COMMAND differs from command, and again, this must be considered in both this and the help map.
|
protected |
Function pointer to be used within the command map and executed by each command
tcCommandExecutiveBase::tcCommandExecutiveBase | ( | const char * | appname | ) |
Constructor, Create an input thread and then populate the menu and the help menu.
|
protected |
Create the command map by corresponding all lower case strings with function pointers to be executed when these strings are entered Major program controls for help and general control Also pass help info off to the help object.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Generic "on/off" asker.
|
protected |
|
protected |
|
protected |
Generic "yes/no" asker.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Prints either a single command, all commands, or an error, depending on the help string.
|
protected |
Prints out a help summary of all the commands available. Iterates through the map and prints all COMMAND help items
|
protected |
Prints generic formatted help for the specfied command and info.
|
protected |
void tcCommandExecutiveBase::start | ( | ) |
Starts the UI thread, which will simply take user input and perform some operation given a user command (if it is found within the command map)
This function starts up the command executive iff it has not already been started. A thread is created and launched to monitor user input through stdin.
|
protected |
Runs a loop which accepts user input, and when that input is received, the appropriate method is called using the command map
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
Thread handle for User Input.
|
protected |
Tells the UI thread when QUIT command has been given.