#include #include #include #include /* ,-------------------. z | S |<--- T w | x y | o---+--> A ---> B <---o | | | `-------------------ยด */ namespace sc = boost::statechart; namespace mpl = boost::mpl; struct w: sc::event< w > {}; struct x: sc::event< x > {}; struct y: sc::event< y > {}; struct z: sc::event< z > {}; struct A; struct FSM: sc::state_machine< FSM, A > {}; // w struct S; struct T: sc::simple_state< T, FSM > { typedef sc::transition< z, S > reactions; }; struct B; struct S: sc::simple_state< S, FSM, B > {}; // y struct B: sc::simple_state< B, S > {}; struct A: sc::simple_state< A, S > { typedef sc::transition< x, B > reactions; }; int main() { FSM fsm; fsm.initiate(); return 0; }