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

Method react

examples/api/multiple_switch.cpp:83–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 DumpState(inum, "OFF", base::on_counter, base::defect_level);
82 };
83 void react(Toggle const &) override {
84 if((rand() % (base::defect_level + 1)) == 0)
85 base::template transit< On<inum> >();
86 else {
87 std::cout << "* Kzzz kzzzzzz" << std::endl;
88 base::template transit< Off<inum> >();
89 }
90 };
91};
92
93FSM_INITIAL_STATE(DefectiveSwitch<0>, Off<0> )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected