---------------------------------------------------------------------------- 2. State Machine Base Class Declaration
| 11 | // 2. State Machine Base Class Declaration |
| 12 | // |
| 13 | struct Switch : tinyfsm::MealyMachine<Switch> |
| 14 | { |
| 15 | /* pure virtual reaction (override required in all states) */ |
| 16 | virtual void react(Toggle const &) = 0; |
| 17 | |
| 18 | /* transition actions */ |
| 19 | static void OpenCircuit() { |
| 20 | std::cout << "* Opening ciruit (light goes OFF)" << std::endl; |
| 21 | } |
| 22 | static void CloseCircuit() { |
| 23 | std::cout << "* Closing ciruit (light goes ON)" << std::endl; |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | |
| 28 | // ---------------------------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected