ITCH 5.0 Market Data Handler 1.0.0
NASDAQ ITCH 5.0 Market Data Feed Handler
Loading...
Searching...
No Matches
b2bits::nasdaq::moldudp64::MessageBlock Class Reference

Compile-time validation of RequestPacket wire format size. More...

Detailed Description

Compile-time validation of RequestPacket wire format size.

MoldUDP64 message block header

Header preceding each individual message within a MoldUDP64 packet. The header contains only the message length, allowing variable-length messages to be packed sequentially within a packet.

Wire format (2 bytes):

  • Length (2 bytes): Message length excluding this 2-byte header

The actual payload follows immediately after this header. To get the total size including the header, use get_message_length() which adds sizeof(len_) to the stored value.

Note
The length field is in network byte order (big-endian)
Length does NOT include the 2-byte header itself
Maximum message payload is 65535 bytes

#include <nasdaq/moldudp64/Messages.h>

Inheritance diagram for b2bits::nasdaq::moldudp64::MessageBlock:

Public Member Functions

 MessageBlock ()=default
 Default constructor.
 MessageBlock (UInt16 len)
 Construct with message length.
UInt16 get_message_length () const
 Get total message size including header.
void set_message_length (UInt16 val)
 Set message length.

Constructor & Destructor Documentation

◆ MessageBlock() [1/2]

b2bits::nasdaq::moldudp64::MessageBlock::MessageBlock ( )
default

Default constructor.

◆ MessageBlock() [2/2]

b2bits::nasdaq::moldudp64::MessageBlock::MessageBlock ( UInt16 len)
inline

Construct with message length.

Parameters
lenMessage length in host byte order

Member Function Documentation

◆ get_message_length()

UInt16 b2bits::nasdaq::moldudp64::MessageBlock::get_message_length ( ) const
inline

Get total message size including header.

Returns the complete message size including this 2-byte header. This is the size needed to iterate to the next message in a packet.

Returns
Total message size (payload + 2-byte header) in host byte order

Referenced by b2bits::nasdaq::moldudp64::SequencerImpl::clone().

◆ set_message_length()

void b2bits::nasdaq::moldudp64::MessageBlock::set_message_length ( UInt16 val)
inline

Set message length.

Sets the message payload length. The value is automatically adjusted to exclude the header size before storage.

Parameters
valTotal message size (including 2-byte header) in host byte order

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