|
Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
|
The application messages a binary session has sent, kept by sequence number so a client can ask for them again. More...
#include <order_gateway/retransmit_ring.hpp>
Classes | |
| struct | Slot |
Public Member Functions | |
| RetransmitRing ()=default | |
| Empty, with no slots: holds nothing until resized. | |
| RetransmitRing (size_t capacity) | |
| Slot & | claim (uint32_t seq) noexcept |
| Claims seq's slot and returns it for the message to be encoded into. | |
| const Slot * | find (uint32_t seq) const noexcept |
| The message sent as seq, or null when it never was or has been overwritten. | |
| bool | holds (uint32_t from, uint32_t count) const noexcept |
| True when every message in [from, from + count) is still held. | |
| void | clear () noexcept |
| Forgets every message, keeping the slots. | |
| void | resize (size_t capacity) |
| void | swap (RetransmitRing &other) noexcept |
| bool | empty () const noexcept |
| size_t | capacity () const noexcept |
The application messages a binary session has sent, kept by sequence number so a client can ask for them again.
Fixed slots, indexed by seq % capacity: a message is encoded straight into its slot, and the oldest is overwritten once capacity newer ones have been sent. Only construction and resize() allocate.
Sequence numbers start at 1; 0 marks an empty slot.
Definition at line 19 of file retransmit_ring.hpp.
|
default |
|
inlineexplicit |
Definition at line 32 of file retransmit_ring.hpp.
References capacity().
|
inlinenodiscardnoexcept |
Definition at line 77 of file retransmit_ring.hpp.
Referenced by RetransmitRing(), and resize().
|
inlinenoexcept |
Claims seq's slot and returns it for the message to be encoded into.
Definition at line 35 of file retransmit_ring.hpp.
|
inlinenoexcept |
Forgets every message, keeping the slots.
Definition at line 67 of file retransmit_ring.hpp.
|
inlinenodiscardnoexcept |
Definition at line 76 of file retransmit_ring.hpp.
|
inlinenodiscardnoexcept |
The message sent as seq, or null when it never was or has been overwritten.
Definition at line 45 of file retransmit_ring.hpp.
Referenced by holds().
|
inlinenodiscardnoexcept |
True when every message in [from, from + count) is still held.
Counted by offset rather than by from + count, so a range that runs over the end of the 32-bit sequence space neither wraps the bound nor ends the loop early.
Definition at line 57 of file retransmit_ring.hpp.
References find().
|
inline |
Definition at line 73 of file retransmit_ring.hpp.
References capacity().
|
inlinenoexcept |
Definition at line 74 of file retransmit_ring.hpp.
References RetransmitRing().