tinyfsm icon indicating copy to clipboard operation
tinyfsm copied to clipboard

Handle multiple FSMs

Open amiguels opened this issue 2 years ago • 3 comments

I have the need to have, in parallel, several FSM that are exactly the same, but that will be in different states as they respond to a button, but that button is different for all of them.

Considering tinyfsm FSMs are not instances, what is the best way to handle this?

amiguels avatar Apr 27 '23 11:04 amiguels

add a context as a container to hold the instance replace the global static pointer

kth8384 avatar Nov 04 '23 22:11 kth8384

Hello,

I have a need to create a vector of FSMs so that I can maintain individual states. The size of the vector is dynamic and will be defined during runtime. Any idea how I can do this??

I would want something like this std::vector<FSM> vec;

vec[0]::dispatc(event0); vec[1]::dispatch(event1);

chinjo1296 avatar Dec 04 '23 12:12 chinjo1296