Module buffer

Module buffer 

Source
Expand description

Buffer management for FIX message creation and manipulation.

This module provides high-performance buffer initialization and management specifically designed for FIX protocol message generation. The core concept is pre-initializing buffers with the fixed header structure that appears in every FIX message.

Constants§

BEGIN_STRING_POS
Position where BeginString starts (always 0).
BODY_LENGTH_VALUE_POS
Position where BodyLength value starts (the “0000” part).
FORGE_BUFFER_SIZE
Default buffer size for FIX message writing operations. 1024 bytes should accommodate most FIX messages in practice.
FORGE_HEADER
The complete pre-initialized header that is baked into every forge buffer. Layout: “8=FIX.4.4\x019=0000\x0135=”
FORGE_HEADER_LEN
Length of the complete pre-initialized header.
FORGE_WRITE_START
Starting position for writing MsgType value after the pre-initialized header. This is where MsgType value writing should begin.
MSG_TYPE_TAG_POS
Position where MsgType tag starts (“35=”).

Functions§

forge_out_buffer
Create a pre-initialized buffer for FIX message writing.
update_body_length
Update the BodyLength field in a forge buffer with the actual message length.