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§
- BODY_
LENGTH_ VALUE_ POS - Position where BodyLength value starts (the “0000” part). For all FIX 4.x versions: “8=FIX.4.x\x01” (10 bytes) + “9=” (2 bytes) = position 12
- FORGE_
BUFFER_ SIZE - Default buffer size for FIX message writing operations. 1024 bytes should accommodate most FIX messages in practice.
- FORGE_
HEADER_ LEN - Length of the complete pre-initialized header for FIX 4.x versions. Layout: “8=FIX.4.4\x019=0000\x0135=” (20 bytes) Layout: “8=FIX.4.2\x019=0000\x0135=” (20 bytes) All FIX 4.x versions have the same header length.
- FORGE_
WRITE_ START - Starting position for writing MsgType value after the pre-initialized header. This is where MsgType value writing should begin for all FIX 4.x versions.
Functions§
- forge_
out_ buffer - Create a pre-initialized buffer for FIX message writing with specified version.
- forge_
write_ start - Get the starting position for writing MsgType value for FIX 4.x versions. All FIX 4.x versions have the same header length, so this returns the constant.
- update_
body_ length - Update the BodyLength field in a forge buffer with the actual message length.