1 #ifndef FACT_StateMachineDimControl 2 #define FACT_StateMachineDimControl 40 std::string
Line(
const std::string &txt,
char fill);
59 bool HasServer(
const std::string &server);
62 std::vector<std::string>
GetCommandList(
const std::string &server);
64 std::vector<Description>
GetDescription(
const std::string &service);
65 std::vector<State>
GetStates(
const std::string &server);
69 int PrintDescription(std::ostream &out,
bool iscmd,
const std::string &
serv=
"",
const std::string &service=
"");
73 bool SendDimCommand(
const std::string &server, std::string
str, std::ostream &lout);
75 void SetStateCallback(
const std::function<
void(
const std::string &,
const State &)> &func) { fStateCallback = func; }
79 void Stop(
int code=0);
void Stop(int code=0)
Request to stop the mainloop.
void SetInterruptHandler(const std::function< int(const EventImp &)> &func=std::function< int(const EventImp &)>())
A general base-class describing events issues in a state machine.
int HandleAddService(const Service &svc)
bool SendDimCommand(const std::string &server, std::string str, std::ostream &lout)
std::function< void(const std::string &, const State &)> fStateCallback
std::function< int(const EventImp &)> fInterruptHandler
Adds some functionality to boost::posix_time::ptime for our needs.
int HandleStates(const std::string &server, DimDescriptions *state)
std::map< std::string, std::vector< std::string > > fCommandList
void SetStateCallback(const std::function< void(const std::string &, const State &)> &func)
int EvalOptions(Configuration &conf)
std::map< std::pair< std::string, int32_t >, std::pair< std::string, std::string > > fStateDescriptionList
StateMachineDimControl(std::ostream &out=std::cout)
int PrintDescription(std::ostream &out, bool iscmd, const std::string &serv="", const std::string &service="")
int HandleDescriptions(DimDescriptions *state)
int PrintStates(std::ostream &out, const std::string &serv="")
int HandleStateChange(const std::string &server, DimDescriptions *state)
std::map< std::string, State > fCurrentStateList
std::set< Service > GetServiceList()
std::string fArgumentsJS
Default arguments provided to very java script.
std::map< std::string, std::vector< Description > > fServiceDescriptionList
std::vector< std::string > GetServerList()
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Commandline parsing, resource file parsing and database access.
State GetServerState(const std::string &server)
std::set< Service > fServiceList
DimDnsServiceList fDimList
int HandleServerRemove(const std::string &server)
int StartScript(const EventImp &imp, const std::string &cmd)
std::string Line(const std::string &txt, char fill)
int ChangeState(int qos, const Time &time, int scriptdepth, std::string scriptfile, std::string user)
std::vector< Description > GetDescription(const std::string &service)
int HandleServerAdd(const std::string &server)
Class for a state machine implementation within a DIM network.
std::vector< State > GetStates(const std::string &server)
std::vector< DimDescriptions * > fDimDescriptionsList
~StateMachineDimControl()
std::vector< std::string > GetCommandList()
int StopScript(const EventImp &imp)
int InterruptScript(const EventImp &imp)
bool HasServer(const std::string &server)
std::set< std::string > fServerList