86 if (
str.substr(0, 2)==
"h " ||
str.substr(0, 5)==
"help ")
94 if (
str==
"states" ||
str==
"st")
99 if (
str==
"allowed" ||
str==
"ac")
101 lout << endl <<
kBold <<
"List of commands allowed in current state:" << endl;
107 if (
str.substr(0, 3)==
".s ")
109 istringstream in(
str.substr(3));
111 int state=-100, ms=0;
116 lout <<
kRed <<
"Couldn't parse state id in '" <<
str.substr(3) <<
"'" << endl;
130 if (in.fail() && !in.eof())
132 lout <<
kRed <<
"Invalid label in '" <<
str.substr(3) <<
"'" << endl;
int Comment(const std::string &str)
void PrintListOfStates(std::ostream &out) const
int GetCurrentState() const
return the current state of the machine
bool PostEvent(std::ostream &lout, const std::string &str)
Post an event to the event queue.
Adds some functionality to boost::posix_time::ptime for our needs.
StateMachineImp * fStateMachine
bool Process(std::ostream &out, const std::string &str)
void PrintListOfEvents(std::ostream &out, const std::string &evt="")
void PrintListOfAllowedEvents(std::ostream &out)
Do not initialize the time.