28 std::cout <<
"switch at " << milli_time() <<
"\n";
29 emit(
Event(
"switch"));
46 std::cout <<
"entering " + name() <<
"\n";
The Process Manager class.
A generic state class with nothing more than a name. See examples/toggle_switch.cc.
Manager & schedule(Process &process, high_resolution_clock::duration period)
void entry(const Event &e)
Print something when the state is entered.
StateMachine & add_transition(std::string event_name, State &from, State &to)
void during()
Do nothing while the state is active.
void init()
Nothing to do for init.
Manager & run(high_resolution_clock::duration runtime)
StateMachine & set_initial(State &s)
Trigger()
Wrap the base process class.
Events that can be emitted, watched, and responded to with event handlers.
void exit(const Event &)
Do nothing upon exiting the state.
States for the StateMachine class.
A process class that sends switch events. See examples/toggle_switch.cc.
void stop()
Nothing to do to stop.
void update()
Emit a switch event each time called.
Mode(std::string name)
Wrap the base state class.
StateMachine & set_propagate(bool val)
void start()
Nothing to do upon starting.
A finite state machine class.
An abstract base class for processes.