| 66 | } |
| 67 | |
| 68 | void 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 | |
| 82 | void Switch::exit() { |
| 83 | assert(current_state_ptr == this); |
nothing calls this directly
no outgoing calls
no test coverage detected