65 fDescriptionStates(name+
"/STATE_LIST",
"C",
66 "Provides a list with descriptions for each service." 67 "|StateList[string]:A \\n separated list of the form id:name=description"),
68 fSrvState(name+
"/STATE",
"C",
69 "Provides the state of the state machine as quality of service." 70 "|Text[string]:A human readable string sent by the last state change.")
120 str += to_string(it->first)+
':'+it->second.first+
'='+it->second.second+
'\n';
228 Out() <<
" -- " <<
Time().
GetAsStr() <<
" - EXIT(" << code <<
") command received." << endl;
int GetStateIndex(const std::string &name) const
DimDescribedService fDescriptionStates
Version number.
virtual void Stop(int code=0)
Request to stop the mainloop.
void commandHandler()
Overwritten DimCommand::exitHandler.
A general base-class describing events issues in a state machine.
Base class for a state machine implementation.
bool PostEvent(std::ostream &lout, const std::string &str)
Post an event to the event queue.
void setQuality(int quality)
const std::string & GetName() const
Adds some functionality to boost::posix_time::ptime for our needs.
StateMachineDim(std::ostream &out=std::cout, const std::string &name="DEFAULT")
void infoHandler()
Overwritten DimCommand::commandHandler.
int Write(const Time &t, const std::string &txt, int qos=kInfo)
static const int fVersion
DimCommand * getCommand()
std::ostream & Out() const
void SetDefaultStateNames()
void exitHandler(int code)
DimService offering fCurrentState.
EventImp * CreateService(const std::string &name)
bool HasEvent(const EventImp *cmd)
DimDescribedService fSrvState
DimService propagating the state descriptions.
Concerete implementation of an EventImp as a DimCommand.
int Write(const Time &time, const std::string &txt, int qos=kMessage)
Redirect our own logging to fLog.
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
EventImp * CreateEvent(const std::string &name, const std::string &fmt)
Overwritten DimInfo::infoHandler.
bool HasState(int index) const
Ensures that the MessageDimTX is initialized before errors could be redirected to it...
Ensures calling DimServer::start() in its constructor and DimServer::stop() in its destructor...
StateNames fStateNames
Human readable names associated with the states.
virtual std::string SetCurrentState(int state, const char *txt="", const std::string &cmd="")
Possible return value for GetStateIndex.
virtual bool AddStateName(const int state, const std::string &name, const std::string &doc="")
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const
bool AddStateName(const int state, const std::string &name, const std::string &doc="")
std::string SetCurrentState(int state, const char *txt="", const std::string &cmd="")