13 #define LOG_STATEMACHINE_WARN(...) Utils::log("StateMachine", __VA_ARGS__);
14 #define LOG_STATEMACHINE_INFO(...) Utils::log("StateMachine", __VA_ARGS__);
15 #define LOG_STATEMACHINE_DEBUG(...) Utils::log("StateMachine", __VA_ARGS__);
21 : _currentStateId(initialStateId)
36 bool stateEntry =
false;
37 bool stateWasUpdated =
false;
64 itStateAction->second->invokeStateAction(
this,
72 ss <<
"You forgot to register state "
87 itStateAction->second->invokeStateAction(
this,
95 ss <<
"You forgot to register state "
103 stateWasUpdated =
true;
115 if (!stateWasUpdated)
#define LOG_STATEMACHINE_DEBUG(...)
std::queue< Event * > _events
Event class used in the state machine.
EventData * getEventData()
Get event data that was possibly send with this event. If the function returns nullptr,...
const char * name() const
const char * senderInfo() const
unsigned int getNewState(unsigned int currentState)
Check if there is a transition to a new state. The current state is used to lookup the new state.
unsigned int _currentStateId
virtual std::string getPrintableState(unsigned int state)=0
StateMachine(unsigned int initialStateId)
bool update()
process events and update current state
std::map< unsigned int, sm::StateBase * > _stateActions
void exitMsg(const char *tag, const char *msg, const int line, const char *file)
Terminates the application with a message. No leak checking.
Collection of classes for a state machine implementation used in the Erleb-AR app.