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

Class Switch

examples/api/resetting_switch.cpp:16–32  ·  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//
16class Switch
17: public tinyfsm::Fsm<Switch>
18{
19 // entry(), exit() and react() are called from Fsm<Switch>::transit()
20 // in derived states, make friends:
21 friend class tinyfsm::Fsm<Switch>;
22
23 /* default reaction for unhandled events */
24 void react(tinyfsm::Event const &) { };
25
26 virtual void react(Toggle const &) { };
27 virtual void entry(void) { }; /* entry actions in some states */
28 void exit(void) { }; /* no exit actions */
29
30public:
31 static void reset(void); /* implemented below */
32};
33
34
35// ----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected