---------------------------------------------------------------------------- 2. State Machine Base Class Declaration
| 14 | // 2. State Machine Base Class Declaration |
| 15 | // |
| 16 | class 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 | |
| 30 | public: |
| 31 | static void reset(void); /* implemented below */ |
| 32 | }; |
| 33 | |
| 34 | |
| 35 | // ---------------------------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected