10 #ifndef SM_STATE_MACHINE_H
11 #define SM_STATE_MACHINE_H
38 const bool stateEntry,
39 const bool stateExit)
const {};
52 void (SM::*Func)(
const Data*,
60 const bool stateEntry,
61 const bool stateExit)
const
64 SM* derivedSM =
static_cast<SM*
>(
sm);
66 const Data* derivedData =
dynamic_cast<const Data*
>(data);
69 (derivedSM->*Func)(derivedData, stateEntry, stateExit);
93 void (SM::*Func)(
const Data*,
98 assert(_stateActions.find(stateId) == _stateActions.end());
103 unsigned int _currentStateId = 0;
Event class used in the state machine.
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
virtual void invokeStateAction(StateMachine *sm, const EventData *data, const bool stateEntry, const bool stateExit) const
Abstract state base class that all states inherit from.
virtual void invokeStateAction(StateMachine *sm, const EventData *data, const bool stateEntry, const bool stateExit) const
void registerState(unsigned int stateId)
register state processing functions from deriving class
virtual std::string getPrintableState(unsigned int state)=0
std::map< unsigned int, sm::StateBase * > _stateActions
Collection of classes for a state machine implementation used in the Erleb-AR app.