38 return "State::kSendStops";
40 return "State::kReset";
42 return "State::kIdle";
44 return "State::kObserve";
48 return "State::kShutdown";
50 return "State::kOver";
115 void enter_state(
const State& next_state) noexcept;
118 void process_cycle_beginning();
121 void process_cycle_end();
131 unsigned stop_cycles_;
Memory map to shared memory.
void process_event(const Event &event) noexcept
Process a new event.
StateMachine(AgentInterface &interface) noexcept
Initialize state machine.
const State & state() const noexcept
Get current state.
bool is_over_after_this_cycle() const noexcept
Whether we transition to the terminal state at the next end-cycle event.
Inter-process communication protocol with the spine.
constexpr unsigned kNbStopCycles
When sending stop cycles, send at least that many.
Event
Events that may trigger transitions between states.
State
States of the state machine.
constexpr const char * state_name(const State &state) noexcept
Name of a state.