|
ITCHCPP 1.6.1
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
A stateful decoder for a SoupBinTCP byte stream. More...
#include <soupbintcp.hpp>
Public Types | |
| using | EventCallback = std::function< void(SoupBinPacketType type, std::span< const std::byte > payload)> |
| Invoked for each non-data control packet, with its raw payload. | |
Public Member Functions | |
| SoupBinDecoder (MessageCallback callback) | |
Constructs a decoder that calls callback for each ITCH message. | |
| auto | feed (std::span< const std::byte > bytes) -> void |
| Feeds a chunk of the TCP byte stream, processing any complete packets it completes. | |
| auto | set_event_callback (EventCallback callback) -> void |
| Installs the control-packet event callback (empty clears it). | |
| auto | tracker () noexcept -> SequenceTracker & |
| The embedded sequence tracker (install gap callbacks here). | |
| auto | tracker () const noexcept -> const SequenceTracker & |
| The embedded sequence tracker (install gap callbacks here). | |
| auto | current_session () const -> std::string_view |
| The session id learned from Login Accepted (empty until then). | |
| auto | next_sequence () const noexcept -> std::uint64_t |
| The next sequence number the decoder expects for a data packet. | |
| auto | messages_decoded () const noexcept -> std::uint64_t |
| Total sequenced/unsequenced data messages decoded. | |
A stateful decoder for a SoupBinTCP byte stream.
Because TCP delivers a byte stream rather than discrete packets, the decoder accumulates input across feed calls and emits messages only for complete packets. Sequenced (and, optionally, unsequenced) data packets each carry a single ITCH message, which is decoded through an internal Parser and handed to the MessageCallback. Control packets (login, heartbeat, logout, end of session) are surfaced through the optional event callback. The starting sequence number is learned from the Login Accepted packet and advanced per sequenced message, with gaps reported through the embedded SequenceTracker.
Definition at line 57 of file soupbintcp.hpp.
| using itch::transport::SoupBinDecoder::EventCallback = std::function<void(SoupBinPacketType type, std::span<const std::byte> payload)> |
Invoked for each non-data control packet, with its raw payload.
Definition at line 60 of file soupbintcp.hpp.
|
explicit |
Constructs a decoder that calls callback for each ITCH message.
| callback | Invoked with each ITCH message decoded from a sequenced or unsequenced data packet. |
Definition at line 47 of file soupbintcp.cpp.
| auto itch::transport::SoupBinDecoder::feed | ( | std::span< const std::byte > | bytes | ) | -> void |
Feeds a chunk of the TCP byte stream, processing any complete packets it completes.
| bytes | The next contiguous chunk of bytes read from the TCP connection. |
Definition at line 53 of file soupbintcp.cpp.
| auto itch::transport::SoupBinDecoder::set_event_callback | ( | EventCallback | callback | ) | -> void |
Installs the control-packet event callback (empty clears it).
| callback | Invoked for each non-data control packet decoded. |
Definition at line 49 of file soupbintcp.cpp.
|
inlinenoexcept |
The embedded sequence tracker (install gap callbacks here).
SequenceTracker. Definition at line 83 of file soupbintcp.hpp.
|
inlinenoexcept |
The embedded sequence tracker (install gap callbacks here).
SequenceTracker. Definition at line 86 of file soupbintcp.hpp.
|
inline |
The session id learned from Login Accepted (empty until then).
Definition at line 90 of file soupbintcp.hpp.
|
inlinenoexcept |
The next sequence number the decoder expects for a data packet.
Definition at line 94 of file soupbintcp.hpp.
|
inlinenoexcept |
Total sequenced/unsequenced data messages decoded.
Definition at line 98 of file soupbintcp.hpp.