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

Represents a single FIX protocol session. More...

#include <fix_session.h>

Inherits ManagedInstanceSession.

Public Member Functions

std::string get_name () const override
 Returns the logical name of the FIX session. More...
 
SessionState get_state ()
 Retrieves the current state of the FIX session. More...
 
SequenceStoreget_sequence_store ()
 Provides access to the session's sequence store. More...
 
template<typename T >
bool add_attribute (const std::string &attribute, const T &value)
 Adds or updates a session-scoped attribute. More...
 
bool get_attribute (const std::string &attribute, std::string &value) const
 Retrieves a session attribute value. More...
 

Detailed Description

Represents a single FIX protocol session.

FixSession encapsulates the full lifecycle, state management, sequencing, throttling, validation, and message handling logic for a FIX connection.

Member Function Documentation

◆ add_attribute()

template<typename T >
bool llfix::FixSession::add_attribute ( const std::string &  attribute,
const T &  value 
)
inline

Adds or updates a session-scoped attribute.

Attributes are stored as key/value string pairs and can be used to associate arbitrary metadata with a session instance.

Supported value types:

  • std::string
  • Arithmetic types (converted via std::to_string)
  • Any type supporting stream insertion (operator<<)
Template Parameters
TAttribute value type.
Parameters
attributeAttribute name (key).
valueAttribute value.
Returns
true if the attribute was added successfully, false otherwise.

◆ get_attribute()

bool llfix::FixSession::get_attribute ( const std::string &  attribute,
std::string &  value 
) const
inline

Retrieves a session attribute value.

Looks up an attribute by name and returns its value if present.

Parameters
attributeAttribute name (key).
valueOutput parameter receiving the attribute value.
Returns
true if the attribute exists, false otherwise.

◆ get_name()

std::string llfix::FixSession::get_name ( ) const
inlineoverride

Returns the logical name of the FIX session.

The session name uniquely identifies this FixSession instance and is typically configured during initialisation.

Returns
Session name as a std::string.

◆ get_sequence_store()

SequenceStore* llfix::FixSession::get_sequence_store ( )
inline

Provides access to the session's sequence store.

The sequence store maintains incoming and outgoing FIX message sequence numbers and persists them according to configuration.

Returns
Pointer to the underlying SequenceStore.

◆ get_state()

SessionState llfix::FixSession::get_state ( )
inline

Retrieves the current state of the FIX session.

The returned value represents the lifecycle and connection state of the session. Possible states are:

  • SessionState::NONE Session has not been initialised.
  • SessionState::DISABLED Session is administratively disabled.
  • SessionState::DISCONNECTED Session is not connected to the peer.
  • SessionState::LOGGED_OUT Session is disconnected after a successful logout.
  • SessionState::LOGON_REJECTED Logon attempt was rejected by the peer.
  • SessionState::PENDING_CONNECTION TCP connection established, waiting to initiate logon.
  • SessionState::PENDING_LOGON Logon message sent, awaiting logon response.
  • SessionState::PENDING_LOGOUT Logout message sent or received, awaiting completion.
  • SessionState::LOGGED_ON Session is logged on and fully operational.
  • SessionState::IN_RETRANSMISSION_INITIATED_BY_SELF Session is retransmitting messages initiated by this side.
  • SessionState::IN_RETRANSMISSION_INITIATED_BY_PEER Session is retransmitting messages initiated by the peer.
Returns
Current SessionState.

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