llfix
Low-latency FIX engine
llfix::OutgoingFixMessage Class Reference

FIX message builder and encoder for outbound messages. More...

#include <outgoing_fix_message.h>

Public Member Functions

void set_msg_type (char c)
 Sets FIX MsgType (tag 35) using a single character. More...
 
void set_msg_type (std::string_view buffer)
 Sets FIX MsgType (tag 35) using a string view. More...
 
template<FixMessageComponent component = FixMessageComponent::BODY, typename T >
void set_tag (uint32_t tag, T val, std::size_t decimal_points=0)
 Appends a FIX tag to the specified message component. More...
 
template<FixMessageComponent component = FixMessageComponent::BODY>
void set_binary_tag (uint32_t tag, const char *buffer, std::size_t data_length)
 Appends a FIX tag using the provided buffer with raw data. More...
 
template<FixMessageComponent component = FixMessageComponent::BODY>
void set_timestamp_tag (uint32_t tag)
 Appends a FIX timestamp tag using the current session time. More...
 
std::string get_sending_time ()
 Returns the currently cached tag 52 (SendingTime) value. More...
 

Detailed Description

FIX message builder and encoder for outbound messages.

Member Function Documentation

◆ get_sending_time()

std::string llfix::OutgoingFixMessage::get_sending_time ( )
inline

Returns the currently cached tag 52 (SendingTime) value.

Returns
SendingTime as a string.

◆ set_binary_tag()

template<FixMessageComponent component = FixMessageComponent::BODY>
void llfix::OutgoingFixMessage::set_binary_tag ( uint32_t  tag,
const char *  buffer,
std::size_t  data_length 
)
inline

Appends a FIX tag using the provided buffer with raw data.

Template Parameters
componentFIX message component to append to (default: FixMessageComponent::BODY)
Parameters
tagFIX tag number representing a binary field
bufferstart address of buffer that hold raw/binary data
data_lengthlength of buffer

◆ set_msg_type() [1/2]

void llfix::OutgoingFixMessage::set_msg_type ( char  c)
inline

Sets FIX MsgType (tag 35) using a single character.

This overload is intended for FIX message types represented by a single character (e.g. 'D', '8', '0').

Parameters
cFIX MsgType character

◆ set_msg_type() [2/2]

void llfix::OutgoingFixMessage::set_msg_type ( std::string_view  buffer)
inline

Sets FIX MsgType (tag 35) using a string view.

Supports multi-character FIX message types (e.g. "AE", "XLR").

Parameters
bufferString view containing the message type
Precondition
Maximum buffer length is 4 characters

◆ set_tag()

template<FixMessageComponent component = FixMessageComponent::BODY, typename T >
void llfix::OutgoingFixMessage::set_tag ( uint32_t  tag,
val,
std::size_t  decimal_points = 0 
)
inline

Appends a FIX tag to the specified message component.

Encodes the supplied value into an internal FixString and appends it to the selected FIX message component (HEADER, BODY, or TRAILER).

Supported Value Types

  • const char*
  • std::string
  • std::string_view
  • char
  • bool (Y/N)
  • FixedPoint
  • Integral types (signed / unsigned)
  • Floating-point types (requires decimal_points)
Template Parameters
componentFIX message component to append to (default: FixMessageComponent::BODY)
TValue type to encode
Parameters
tagFIX tag number
valValue to encode
decimal_pointsNumber of decimal places for floating-point values

◆ set_timestamp_tag()

template<FixMessageComponent component = FixMessageComponent::BODY>
void llfix::OutgoingFixMessage::set_timestamp_tag ( uint32_t  tag)
inline

Appends a FIX timestamp tag using the current session time.

Encodes the current timestamp once per message using the session’s configured sub-second precision and reuses it for all timestamp tags within the same message.

Template Parameters
componentFIX message component to append to (default: FixMessageComponent::BODY)
Parameters
tagFIX tag number representing a timestamp field

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