diff --git a/sample/state_machine.cpp b/sample/state_machine.cpp index 8083f44..b8dd292 100644 --- a/sample/state_machine.cpp +++ b/sample/state_machine.cpp @@ -11,15 +11,13 @@ EVENT(Trigger); STATE(state1); STATE(state2); STATE(state3); STATE(state4); STATE(state5); EVENT(event1); EVENT(event2); EVENT(event3); EVENT(event4); EVENT(event5); -bool action() { +void action() { std::cout << "Trigged" << std::endl; - return true; } int main() { using namespace obfs; using machine = StateMachine< - state1, Stage, Next>, Stage>, @@ -28,7 +26,10 @@ int main() { Next>, Stage>>; - machine::run(); + auto next1 = machine::run(state1{}, event5{}); + auto next2 = machine::run(next1, event2{}); + auto next3 = machine::run(next2, event3{}); + auto next4 = machine::run(next3, Trigger{}); return 0; } \ No newline at end of file