State machine

The state machine is the main object in yasmine containing all other elements. It directly contains the root state which is always a composite state. In yasmine the state machine is the owner of all transitions.

After constructing all the vertices and transitions the main task of the state machine is to process incoming events.

Checking for defects before running the state machine is another feature.

yasmine provides a synchronous and an asynchronous variation of the state machine .

Synchronous state machine

The synchronous state machine runs and processes events in the thread that uses (calls) it. The user can create a thread for the state machine, if he prefers so.

This is the single-threaded variation of the state machine.

The synchronous state machine can still be used in a multi-threaded program!

The class that implements the synchronous state machine is state_machine.

Asynchronous state machine

The asynchronous state machine runs and processes events in its own thread. The events are enqueued from within a user thread but processed in the state machine's own thread.

This is the multi-threaded variation of the state machine.

The class that implements the asynchronous state machine is async_state_machine.