vulp
2.3.0
|
Inter-process communication protocol with the spine. More...
Namespaces | |
exceptions | |
request | |
spine_interface | |
Classes | |
class | AgentInterface |
Memory map to shared memory. More... | |
class | Spine |
Loop transmitting actions to the actuation and observations to the agent. More... | |
class | StateMachine |
Spine state machine. More... | |
Enumerations | |
enum class | Request : uint32_t { kNone = 0 , kObservation = 1 , kAction = 2 , kStart = 3 , kStop = 4 , kError = 5 } |
enum class | State : uint32_t { kSendStops = 0 , kReset = 1 , kIdle = 2 , kObserve = 3 , kAct = 4 , kShutdown = 5 , kOver = 6 } |
States of the state machine. More... | |
enum class | Event : uint32_t { kCycleBeginning = 0 , kCycleEnd = 1 , kInterrupt = 2 } |
Events that may trigger transitions between states. More... | |
Functions | |
void | allocate_file (int file_descriptor, int bytes) |
Allocate file with some error handling. More... | |
constexpr const char * | state_name (const State &state) noexcept |
Name of a state. More... | |
Variables | |
constexpr size_t | kMebibytes = 1 << 20 |
constexpr unsigned | kNbStopCycles = 5 |
When sending stop cycles, send at least that many. More... | |
Inter-process communication protocol with the spine.
Design notes: one alternative was a proper FSM with a clear distinction between states (what the spine is doing) and transitions (agent requests, spine replies, etc.). This could have allowed more granularity, such as the spine doing nothing (instead of sending stops) when it is idle, however at the cost of more complexity. We choose to go for the simpler (riskier) version where both agent and spine directly manipulate the agenda.
|
strong |
Events that may trigger transitions between states.
Enumerator | |
---|---|
kCycleBeginning | |
kCycleEnd | |
kInterrupt |
Definition at line 25 of file StateMachine.h.
|
strong |
|
strong |
States of the state machine.
Enumerator | |
---|---|
kSendStops | |
kReset | |
kIdle | |
kObserve | |
kAct | |
kShutdown | |
kOver |
Definition at line 14 of file StateMachine.h.
void vulp::spine::allocate_file | ( | int | file_descriptor, |
int | bytes | ||
) |
Allocate file with some error handling.
[in] | file_descriptor | File descriptor. |
[in] | bytes | Number of bytes to allocate. |
Definition at line 16 of file AgentInterface.cpp.
|
constexprnoexcept |
|
constexpr |
When sending stop cycles, send at least that many.
Definition at line 11 of file StateMachine.h.