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

Method reset

examples/api/resetting_switch.cpp:61–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61void Switch::reset() {
62 std::cout << "** RESET Switch" << std::endl;
63 // Reset all states (calls constructor on all states in list)
64 tinyfsm::StateList<Off, On>::reset();
65
66 // Alternatively, make counter public above and reset the values
67 // here instead of using a copy-constructor with StateList<>:
68 //state<On>().counter = 0;
69 //state<Off>().counter = 0;
70}
71
72FSM_INITIAL_STATE(Switch, Off)
73

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected