* Abstract state interface. */
| 60 | * Abstract state interface. |
| 61 | */ |
| 62 | class AbstractState |
| 63 | { |
| 64 | public: |
| 65 | |
| 66 | /** |
| 67 | * Constructs a state. |
| 68 | */ |
| 69 | AbstractState() |
| 70 | { |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Destroys a state. |
| 75 | */ |
| 76 | virtual ~AbstractState() |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * The entry is called once, a state is entered. |
| 82 | * |
| 83 | * @param[in] sm Responsible state machine |
| 84 | */ |
| 85 | virtual void entry(StateMachine& sm) = 0; |
| 86 | |
| 87 | /** |
| 88 | * The process routine is called cyclic, as long as the state is active. |
| 89 | * |
| 90 | * @param[in] sm Responsible state machine |
| 91 | */ |
| 92 | virtual void process(StateMachine& sm) = 0; |
| 93 | |
| 94 | /** |
| 95 | * The exit is called once, a state will be left. |
| 96 | * |
| 97 | * @param[in] sm Responsible state machine |
| 98 | */ |
| 99 | virtual void exit(StateMachine& sm) = 0; |
| 100 | |
| 101 | private: |
| 102 | |
| 103 | AbstractState(const AbstractState& state); |
| 104 | AbstractState& operator=(const AbstractState& state); |
| 105 | }; |
| 106 | |
| 107 | /** |
| 108 | * Generic state machine. |
nothing calls this directly
no outgoing calls
no test coverage detected