74 auto feed(std::span<const std::byte> bytes) -> void;
90 [[nodiscard]]
auto current_session() const -> std::string_view {
return m_session; }
94 [[nodiscard]]
auto next_sequence() const noexcept -> std::uint64_t {
return m_next_sequence; }
99 return m_messages_decoded;
108 auto process_packet(
SoupBinPacketType type, std::span<const std::byte> payload) -> void;
115 auto decode_application_message(std::span<const std::byte> payload) -> void;
120 SequenceTracker m_tracker {};
121 std::vector<std::byte> m_buffer {};
122 std::string m_session {};
123 std::uint64_t m_next_sequence {1};
124 std::uint64_t m_messages_decoded {0};
A high-performance parser for the NASDAQ TotalView-ITCH 5.0 protocol.
Tracks per-session sequence numbers across a transport layer and surfaces gaps.
A stateful decoder for a SoupBinTCP byte stream.
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 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.
auto current_session() const -> std::string_view
The session id learned from Login Accepted (empty until then).
auto tracker() const noexcept -> const SequenceTracker &
The embedded sequence tracker (install gap callbacks here).
std::function< void(SoupBinPacketType type, std::span< const std::byte > payload)> EventCallback
Invoked for each non-data control packet, with its raw payload.
auto feed(std::span< const std::byte > bytes) -> void
Feeds a chunk of the TCP byte stream, processing any complete packets it completes.
SoupBinPacketType
The SoupBinTCP packet types (the one-byte type that follows the 2-byte length prefix).
@ login_request
Client login request.
@ login_rejected
Reject reason code (1).
@ login_accepted
Session id (10) + starting sequence number (20, ASCII).
@ end_of_session
The server has finished the session.
@ server_heartbeat
Keep-alive from the server.
@ logout_request
Client logout request.
@ unsequenced_data
One unsequenced application message.
@ debug
Free-form debug text (either direction).
@ sequenced_data
One sequenced application (ITCH) message.
@ client_heartbeat
Keep-alive from the client.
std::function< void(const Message &)> MessageCallback
The signature for the callback function used in streaming parse methods.
Public parsing interface for NASDAQ TotalView-ITCH 5.0 feeds, plus the low-level byte-unpacking utili...
Per-session sequence-gap detection shared by the MoldUDP64 and SoupBinTCP transport decoders.