MCPcopy Create free account
hub / github.com/digint/tinyfsm / Switch

Class Switch

examples/api/simple_switch.cpp:16–28  ·  view source on GitHub ↗

---------------------------------------------------------------------------- 2. State Machine Base Class Declaration

Source from the content-addressed store, hash-verified

14// 2. State Machine Base Class Declaration
15//
16struct Switch : tinyfsm::Fsm<Switch>
17{
18 virtual void react(Toggle const &) { };
19
20 // alternative: enforce handling of Toggle in all states (pure virtual)
21 //virtual void react(Toggle const &) = 0;
22
23 virtual void entry(void) { }; /* entry actions in some states */
24 void exit(void) { }; /* no exit actions */
25
26 // alternative: enforce entry actions in all states (pure virtual)
27 //virtual void entry(void) = 0;
28};
29
30
31// ----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected