ITCHCPP 1.6.1
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
itch::transport::MoldUdp64Decoder Class Reference

Decodes MoldUDP64 datagrams and forwards the contained ITCH messages. More...

#include <moldudp64.hpp>

Public Member Functions

 MoldUdp64Decoder (MessageCallback callback)
 Constructs a decoder that calls callback for each ITCH message.
 
auto decode_packet (std::span< const std::byte > packet) -> std::optional< MoldUdp64Header >
 Decodes a single MoldUDP64 datagram.
 
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 packets_decoded () const noexcept -> std::uint64_t
 Total number of datagrams passed to decode_packet.
 
auto messages_decoded () const noexcept -> std::uint64_t
 Total number of ITCH messages decoded from all datagrams.
 

Static Public Attributes

static constexpr std::size_t HEADER_SIZE = 20
 The on-wire size of the MoldUDP64 packet header, in bytes.
 

Detailed Description

Decodes MoldUDP64 datagrams and forwards the contained ITCH messages.

One instance decodes a stream of datagrams from one or more sessions: call decode_packet once per UDP payload. Each well-formed data packet's message blocks are handed to an internal Parser, which invokes the supplied MessageCallback for every decoded ITCH message. Per-packet sequence numbers are fed to an embedded SequenceTracker so gaps in the multicast stream are surfaced to the caller.

Definition at line 71 of file moldudp64.hpp.

Constructor & Destructor Documentation

◆ MoldUdp64Decoder()

itch::transport::MoldUdp64Decoder::MoldUdp64Decoder ( MessageCallback  callback)
explicit

Constructs a decoder that calls callback for each ITCH message.

Parameters
callbackInvoked with each ITCH message decoded from a data packet's message blocks.

Definition at line 21 of file moldudp64.cpp.

Member Function Documentation

◆ decode_packet()

auto itch::transport::MoldUdp64Decoder::decode_packet ( std::span< const std::byte >  packet) -> std::optional<MoldUdp64Header>

Decodes a single MoldUDP64 datagram.

Parameters
packetThe full UDP payload (header plus message blocks).
Returns
The parsed header, or std::nullopt if the datagram is too short to contain a valid header.

Definition at line 23 of file moldudp64.cpp.

◆ tracker() [1/2]

auto itch::transport::MoldUdp64Decoder::tracker ( ) -> SequenceTracker&
inlinenoexcept

The embedded sequence tracker (install gap callbacks here).

Returns
Reference to the embedded SequenceTracker.

Definition at line 90 of file moldudp64.hpp.

◆ tracker() [2/2]

auto itch::transport::MoldUdp64Decoder::tracker ( ) const -> const SequenceTracker&
inlinenoexcept

The embedded sequence tracker (install gap callbacks here).

Returns
Const reference to the embedded SequenceTracker.

Definition at line 93 of file moldudp64.hpp.

◆ packets_decoded()

auto itch::transport::MoldUdp64Decoder::packets_decoded ( ) const -> std::uint64_t
inlinenoexcept

Total number of datagrams passed to decode_packet.

Returns
The count of datagrams decoded so far.

Definition at line 97 of file moldudp64.hpp.

◆ messages_decoded()

auto itch::transport::MoldUdp64Decoder::messages_decoded ( ) const -> std::uint64_t
inlinenoexcept

Total number of ITCH messages decoded from all datagrams.

Returns
The total count of decoded ITCH messages.

Definition at line 103 of file moldudp64.hpp.

Referenced by itch::transport::PcapReader::messages_decoded().

Member Data Documentation

◆ HEADER_SIZE

constexpr std::size_t itch::transport::MoldUdp64Decoder::HEADER_SIZE = 20
staticconstexpr

The on-wire size of the MoldUDP64 packet header, in bytes.

Definition at line 74 of file moldudp64.hpp.


The documentation for this class was generated from the following files: