21 State() : _name(
"unnamed state"), _state_machine_ptr(NULL) {
26 State(std::string
name) : _name(name), _state_machine_ptr(NULL) {
31 inline std::string
name() {
return _name; }
34 inline int id() {
return _id; }
62 static int _id_counter;
virtual void entry(const Event &e)=0
State()
Construct an unnamed State.
Events that can be emitted, watched, and responded to with event handlers.
StateMachine & state_machine()
States for the StateMachine class.
virtual void exit(const Event &e)=0
State(std::string name)
Construct a state with the given name.
void emit(const Event &e)
A finite state machine class.