How do you pass a SM to a function?
Ricodan opened this issue · 1 comments
Ricodan commented
main()
{
MyStateMachine::start();
gatherInformation();
dispatcherAndDecisionMakingFunction(MyStateMachine );
}
Something like this is what I'd like to accomplish.
digint commented
TinyFSM state machines are not instances, you can't "pass" them to a function. What you can do is create a function template, something like this:
// declare function
template<typename F>
dispatcherAndDecisionMakingFunction(void) {
F::staticStateMachineFunction(void);
}
// call function
dispatcherAndDecisionMakingFunction<MyStateMachine>();