---------------------------------------------------------------------------- Main
| 58 | // Main |
| 59 | // |
| 60 | int main() |
| 61 | { |
| 62 | // instantiate events |
| 63 | Toggle toggle; |
| 64 | |
| 65 | fsm_handle::start(); |
| 66 | |
| 67 | while(1) |
| 68 | { |
| 69 | char c; |
| 70 | std::cout << std::endl << "t=Toggle, q=Quit ? "; |
| 71 | std::cin >> c; |
| 72 | switch(c) { |
| 73 | case 't': |
| 74 | std::cout << "> Toggling switch..." << std::endl; |
| 75 | fsm_handle::dispatch(toggle); |
| 76 | // alternative: instantiating causes no overhead (empty declaration) |
| 77 | //fsm_handle::dispatch(Toggle()); |
| 78 | break; |
| 79 | case 'q': |
| 80 | return 0; |
| 81 | default: |
| 82 | std::cout << "> Invalid input" << std::endl; |
| 83 | }; |
| 84 | } |
| 85 | } |
nothing calls this directly
no outgoing calls
no test coverage detected