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

Method entry

examples/api/debugging_switch.cpp:68–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void Switch::entry() {
69 counter++;
70
71 // debugging only. properly designed state machines don't need this:
72 if(is_in_state<On>()) { std::cout << "* On::entry()" << std::endl; }
73 else if(is_in_state<Off>()) { std::cout << "* Off::entry()" << std::endl; }
74 else assert(true);
75
76 assert(current_state_ptr == this);
77 std::cout << " this (cur) = " << this << std::endl
78 << " state<On> = " << &state<On>() << std::endl
79 << " state<Off> = " << &state<Off>() << std::endl;
80}
81
82void Switch::exit() {
83 assert(current_state_ptr == this);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected