call back objects support
Opened this issue · 0 comments
Andrei-Pozolotin commented
- currently,
fsm
can work only with free call back functions:
struct State {
State(void (*on_enter)(), void (*on_state)(), void (*on_exit)());
void (*on_enter)();
void (*on_state)();
void (*on_exit)();
};
-
this makes
fsm
non-composable with objects, lambdas, etc. -
please add support for call back objects instead:
struct State {
virtual void on_enter() = 0;
virtual void on_state() = 0;
virtual void on_exit() = 0;
};
- same also applies to transitions
struct Transition
{
State* state_from;
State* state_to;
int event;
void (*on_transition)();
};