state machines tutorials [closed]

State machines are very simple in C if you use function pointers. Basically you need 2 arrays – one for state function pointers and one for state transition rules. Every state function returns the code, you lookup state transition table by state and return code to find the next state and then just execute it. … Read more

Use cases of the Workflow Engine

I’m biased as well, as I am the main author of StonePath. I have developed workflow applications for the U.S. State Department, the Geneva Centre for Humanitarian Demining, several fortune 500 clients, and most recently the Washington DC Public School System. Every time I have seen a ‘workflow engine’ that tried to be the one … Read more

Boost Statechart vs. Meta State Machine

As there seems to be much interest, please allow me to give my (obviously biased) opinion, which should therefore be taken with a grain of salt: MSM is much faster MSM requires no RTTI or anything virtual MSM has a more complete UML2 support (for example internal transitions, UML-conform orthogonal regions) MSM offers a descriptive … Read more

What is an actual difference between redux and a state machine (e.g. xstate)?

I created XState, but I’m not going to tell you whether to use one over the other; that depends on your team. Instead, I’ll try to highlight some key differences. Redux XState essentially a state container where events (called actions in Redux) are sent to a reducer which update state also a state container, but … Read more

C state-machine design [closed]

State machines that I’ve designed before (C, not C++) have all come down to a struct array and a loop. The structure basically consists of a state and event (for look-up) and a function that returns the new state, something like: typedef struct { int st; int ev; int (*fn)(void); } tTransition; Then you define … Read more

Simple state machine example in C#?

Let’s start with this simple state diagram: We have: 4 states (Inactive, Active, Paused, and Exited) 5 types of state transitions (Begin Command, End Command, Pause Command, Resume Command, Exit Command). You can convert this to C# in a handful of ways, such as performing a switch statement on the current state and command, or … Read more

tech