|
ITCHCPP 1.6.1
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
Tracks per-session sequence numbers across a transport layer and surfaces gaps. More...
#include <sequencing.hpp>
Public Types | |
| using | GapCallback = std::function< void(std::string_view session, std::uint64_t expected, std::uint64_t received)> |
| Invoked once per detected gap with the session, the sequence the tracker expected, and the (higher) sequence actually received. | |
Public Member Functions | |
| auto | observe (std::string_view session, std::uint64_t first_sequence, std::uint64_t count) -> std::uint64_t |
Records that a packet beginning at first_sequence carried count sequenced messages for session. | |
| auto | set_gap_callback (GapCallback callback) -> void |
| Installs the gap-notification callback (empty clears it). | |
| auto | set_retransmit_requester (RetransmitRequester *requester) noexcept -> void |
| Installs a non-owning retransmission hook (nullptr clears it). | |
| auto | expected_next (std::string_view session) const -> std::optional< std::uint64_t > |
| The next sequence number expected for a session, if it has been seen. | |
| auto | gap_count () const noexcept -> std::uint64_t |
| Total number of missing messages detected across all sessions. | |
| auto | messages_seen () const noexcept -> std::uint64_t |
| Total number of distinct sequenced messages observed. | |
| auto | reset () -> void |
| Forgets all per-session state and resets the counters. | |
Tracks per-session sequence numbers across a transport layer and surfaces gaps.
Both the MoldUDP64 and SoupBinTCP decoders feed their per-packet sequence information here. The tracker maintains, per session, the next sequence number it expects to see. When an observed packet starts ahead of that expectation it reports a gap (through the gap callback and the optional RetransmitRequester) and resynchronizes. Duplicate or already-seen sequences are ignored so a replayed recovery stream does not double-count.
Definition at line 71 of file sequencing.hpp.
| using itch::transport::SequenceTracker::GapCallback = std::function< void(std::string_view session, std::uint64_t expected, std::uint64_t received)> |
Invoked once per detected gap with the session, the sequence the tracker expected, and the (higher) sequence actually received.
Definition at line 75 of file sequencing.hpp.
|
inline |
Records that a packet beginning at first_sequence carried count sequenced messages for session.
| session | The session identifier the packet belongs to. |
| first_sequence | The sequence number of the first message in the packet. |
| count | The number of sequenced messages carried by the packet. |
Definition at line 86 of file sequencing.hpp.
|
inline |
Installs the gap-notification callback (empty clears it).
| callback | Invoked once per detected gap. |
Definition at line 123 of file sequencing.hpp.
|
inlinenoexcept |
Installs a non-owning retransmission hook (nullptr clears it).
| requester | Non-owning pointer to the requester to notify on gaps, or nullptr to clear it. |
Definition at line 128 of file sequencing.hpp.
|
inline |
The next sequence number expected for a session, if it has been seen.
| session | The session identifier to look up. |
std::nullopt if the session has not been observed. Definition at line 136 of file sequencing.hpp.
|
inlinenoexcept |
Total number of missing messages detected across all sessions.
Definition at line 147 of file sequencing.hpp.
|
inlinenoexcept |
Total number of distinct sequenced messages observed.
Definition at line 151 of file sequencing.hpp.
|
inline |
Forgets all per-session state and resets the counters.
Definition at line 154 of file sequencing.hpp.