OnixS C++ B3 BOE Binary Order Entry  1.2.0
API Documentation
SessionSettings Class Reference

#include <OnixS/B3/BOE/SessionSettings.h>

Classes

struct  Default
 
struct  Key
 

Public Types

typedef std::vector< std::string > LicenseStores
 

Public Member Functions

 SessionSettings ()
 
Messaging::SessionID sessionId () const noexcept
 
SessionSettingssessionId (Messaging::SessionID value)
 
Messaging::UInt32 enteringFirm () const noexcept
 
SessionSettingsenteringFirm (Messaging::UInt32 value)
 
const std::string & accessKey () const noexcept
 
SessionSettingsaccessKey (const std::string &value)
 
Messaging::CancelOnDisconnectType::Enum cancelOnDisconnectType () const noexcept
 
SessionSettingscancelOnDisconnectType (Messaging::CancelOnDisconnectType::Enum value)
 
const std::string & tradingSystemName () const noexcept
 
SessionSettingstradingSystemName (const std::string &value)
 
const std::string & tradingSystemVersion () const noexcept
 
SessionSettingstradingSystemVersion (const std::string &value)
 
ThreadingModel::Enum threadingModel () const noexcept
 
SessionSettingsthreadingModel (ThreadingModel::Enum value)
 
unsigned receiveSpinningTimeout () const noexcept
 
SessionSettingsreceiveSpinningTimeout (unsigned usecTimeout)
 
unsigned sendSpinningTimeout () const noexcept
 
SessionSettingssendSpinningTimeout (unsigned usecTimeout)
 
unsigned messageGrouping () const noexcept
 
SessionSettingsmessageGrouping (unsigned value)
 
SessionSettingsresetToDefaults ()
 
SessionSettingsaddLicenseStore (const std::string &value)
 
SessionSettingslicenseStore (const std::string &value)
 
const LicenseStoreslicenseStores () const noexcept
 
unsigned licenseAlertingDaysBeforeExpiration () const noexcept
 
SessionSettingslicenseAlertingDaysBeforeExpiration (unsigned days)
 
const std::string & localNetworkInterface () const noexcept
 
SessionSettingslocalNetworkInterface (const std::string &value)
 
const std::string & logFileName () const noexcept
 
SessionSettingslogFileName (const std::string &value)
 
const std::string & storageDirectory () const noexcept
 
SessionSettingsstorageDirectory (const std::string &value)
 
bool localTimeUsage () const noexcept
 
SessionSettingslocalTimeUsage (bool)
 
Messaging::UInt64 fileBasedStorageSegmentSize () const noexcept
 
SessionSettingsfileBasedStorageSegmentSize (Messaging::UInt64 value)
 
unsigned asyncFileBasedStorageQueueMaxSize () const noexcept
 
SessionSettingsasyncFileBasedStorageQueueMaxSize (unsigned value)
 
const CpuIndexesasyncFileBasedStorageThreadAffinity () const noexcept
 
SessionSettingsasyncFileBasedStorageThreadAffinity (const CpuIndexes &cpuIndexes)
 
bool ignoreFileBasedStorageIntegrityErrors () const noexcept
 
SessionSettingsignoreFileBasedStorageIntegrityErrors (bool)
 
bool logBeforeSending () const noexcept
 
SessionSettingslogBeforeSending (bool before)
 
unsigned reconnectAttempts () const noexcept
 
SessionSettingsreconnectAttempts (unsigned reconnectAttempts)
 
unsigned reconnectInterval () const noexcept
 
SessionSettingsreconnectInterval (unsigned value)
 
int socketReceiveBufferSize () const noexcept
 
SessionSettingssocketReceiveBufferSize (int bufferSize)
 
unsigned reasonableTransmissionTime () const noexcept
 
SessionSettingsreasonableTransmissionTime (unsigned percentage)
 
int socketSendBufferSize () const noexcept
 
SessionSettingssocketSendBufferSize (int bufferSize)
 
const CpuIndexesthreadPoolAffinity () const noexcept
 
SessionSettingsthreadPoolAffinity (const CpuIndexes &cpuIndexes)
 
int threadPoolPriority () const noexcept
 
SessionSettingsthreadPoolPriority (int priority)
 
int threadPoolPolicy () const noexcept
 
SessionSettingsthreadPoolPolicy (int policy)
 
bool tcpNoDelayOption () const noexcept
 
SessionSettingstcpNoDelayOption (bool value)
 
unsigned threadPoolSize () const noexcept
 
SessionSettingsthreadPoolSize (unsigned numberOfThreads)
 
unsigned keepAliveInterval () const noexcept
 
SessionSettingskeepAliveInterval (unsigned milliseconds)
 
unsigned codTimeoutWindow () const noexcept
 
SessionSettingscodTimeoutWindow (unsigned milliseconds)
 
bool reportNewMessagesWhileWaitingForMissedMessages () const noexcept
 
SessionSettingsreportNewMessagesWhileWaitingForMissedMessages (bool report)
 
SessionSettingslocalPortRange (PortRange range)
 
PortRange localPortRange () const noexcept
 
SessionSettingsmessagingSchemaVersion (Messaging::SchemaVersion schema)
 
Messaging::SchemaVersion messagingSchemaVersion () const noexcept
 
bool useSpinLock () const noexcept
 
SessionSettingsuseSpinLock (bool value)
 
bool enableRxTimestamp () const noexcept
 
SessionSettingsenableRxTimestamp (bool value)
 
SessionSettingsload (const std::string &configFile)
 
std::string toString () const
 

Static Public Attributes

static const int UseOsDefaultSocketBufferSize = -1
 

Detailed Description

Definition at line 38 of file SessionSettings.h.

Member Typedef Documentation

typedef std::vector<std::string> LicenseStores

Folders that contain license file(s).

Definition at line 180 of file SessionSettings.h.

Constructor & Destructor Documentation

Member Function Documentation

const std::string& accessKey ( ) const
inlinenoexcept
Returns
The token provided by B3 for the FIXP session.

The default value is empty.

Definition at line 72 of file SessionSettings.h.

SessionSettings& accessKey ( const std::string &  value)

Sets the token provided by B3 for the FIXP session.

SessionSettings& addLicenseStore ( const std::string &  value)

Adds the path to the folder that contains license file(s).

unsigned asyncFileBasedStorageQueueMaxSize ( ) const
inlinenoexcept
Returns
the maximum size of the asynchronous session storage queue.

By default, the size is unlimited.

Definition at line 283 of file SessionSettings.h.

SessionSettings& asyncFileBasedStorageQueueMaxSize ( unsigned  value)

Sets the maximum size of the asynchronous session storage queue.

const CpuIndexes& asyncFileBasedStorageThreadAffinity ( ) const
inlinenoexcept
Returns
the CPU index(es) for affinity of the asynchronous session storage threads.

By default, the affinity is not set.

Definition at line 295 of file SessionSettings.h.

SessionSettings& asyncFileBasedStorageThreadAffinity ( const CpuIndexes cpuIndexes)

Specifies the CPU index(es) for affinity of the asynchronous session storage threads.

Messaging::CancelOnDisconnectType::Enum cancelOnDisconnectType ( ) const
inlinenoexcept
Returns
The criteria used to initiate cancel on disconnect mechanism by the gateway.

The default value is DoNotCancelOnDisconnectOrTerminate.

Definition at line 84 of file SessionSettings.h.

SessionSettings& cancelOnDisconnectType ( Messaging::CancelOnDisconnectType::Enum  value)

Sets the criteria used to initiate cancel on disconnect mechanism by the gateway.

unsigned codTimeoutWindow ( ) const
inlinenoexcept
Returns
The CoD timeout window in milliseconds.

The default value is Default::CodTimeoutWindow.

Definition at line 475 of file SessionSettings.h.

SessionSettings& codTimeoutWindow ( unsigned  milliseconds)

Sets the CoD timeout window in milliseconds.

Gateway will not trigger CoD if the customer reconnects within the timeout window (milliseconds) which starts when the triggering event is detected.

Note
Range is 0 (as soon as possible) to 60000.
bool enableRxTimestamp ( ) const
inlinenoexcept
Returns
the value of the option to enable received data timestamp.

The default value is false.

Definition at line 539 of file SessionSettings.h.

SessionSettings& enableRxTimestamp ( bool  value)

Sets the value of the option to enable received data timestamp.

Note
available on Linux only
Messaging::UInt32 enteringFirm ( ) const
inlinenoexcept
Returns
the broker firm id that will enter orders.

The default value is zero.

Definition at line 60 of file SessionSettings.h.

SessionSettings& enteringFirm ( Messaging::UInt32  value)

Sets the broker firm id that will enter orders.

Messaging::UInt64 fileBasedStorageSegmentSize ( ) const
inlinenoexcept
Returns
the segment size for the file-based session storage.

The default value is Default::FileBasedStorageSegmentSize.

Definition at line 271 of file SessionSettings.h.

SessionSettings& fileBasedStorageSegmentSize ( Messaging::UInt64  value)

Sets the segment size for file-based session storage.

bool ignoreFileBasedStorageIntegrityErrors ( ) const
inlinenoexcept
Returns
The file-based storage integrity errors checking mode:
  • true - ignore errors and create a new storage
  • false - throw an exception

The default value is Default::IgnoreFileBasedStorageIntegrityErrors.

Definition at line 310 of file SessionSettings.h.

SessionSettings& ignoreFileBasedStorageIntegrityErrors ( bool  )

Sets the file-based storage integrity errors checking mode.

unsigned keepAliveInterval ( ) const
inlinenoexcept
Returns
the longest time in milliseconds the client system can remain silent before sending a message.

The default value is Default::KeepAliveInterval.

Definition at line 460 of file SessionSettings.h.

SessionSettings& keepAliveInterval ( unsigned  milliseconds)

Sets the longest time in milliseconds the client system can remain silent before sending a message.

Note
Allowed range is between 5000 - 60000. Any value outside this range will be rejected.
unsigned licenseAlertingDaysBeforeExpiration ( ) const
inlinenoexcept
Returns
the number of days to alert before the license expiration.

The default value is Default::LicenseAlertingDaysBeforeExpiration.

Definition at line 194 of file SessionSettings.h.

SessionSettings& licenseAlertingDaysBeforeExpiration ( unsigned  days)
inline

Sets the number of days to alert before the license expiration.

If the amount of remaining license days is less or equal to this number, then the warning is reported to the Handler's log.

The verification is performed during the Session::connect call.

Definition at line 205 of file SessionSettings.h.

SessionSettings& licenseStore ( const std::string &  value)

Sets the path to the folder that contains license file(s).

const LicenseStores& licenseStores ( ) const
inlinenoexcept
Returns
path(s) to the folder that contains license file(s).

The default value is '.'.

Definition at line 186 of file SessionSettings.h.

SessionSettings& load ( const std::string &  configFile)

Loads the settings from the given configuration file.

See also
Key
const std::string& localNetworkInterface ( ) const
inlinenoexcept
Returns
The interface name or IP-address from which the Handler connects to the counterparty.

The default value is empty.

Definition at line 214 of file SessionSettings.h.

SessionSettings& localNetworkInterface ( const std::string &  value)

Specifies the local interface from which the Handler connects to the counterparty.

Each local interface specification could specify the local IP address and port. For instance, localhost and 192.168.0.1:4501 are valid values.

SessionSettings& localPortRange ( PortRange  range)

Sets the range of the local ports to be used.

PortRange localPortRange ( ) const
inlinenoexcept
Returns
the range of the local ports to be used

Definition at line 507 of file SessionSettings.h.

bool localTimeUsage ( ) const
inlinenoexcept
Returns
the usage of the local time in Handler events and log files.

The default value is Default::LocalTimeUsage.

Definition at line 257 of file SessionSettings.h.

SessionSettings& localTimeUsage ( bool  )

Specifies the usage of the local time in Handler events and log files.

If it is true, then the local time is used; otherwise - UTC.

bool logBeforeSending ( ) const
inlinenoexcept
Returns
true if outbound messages are logged before sending, 'false' otherwise.

The default value is Default::LogBeforeSending.

Definition at line 322 of file SessionSettings.h.

SessionSettings& logBeforeSending ( bool  before)

Controls the order of logging and sending outbound messages.

Parameters
beforeif 'true' then outbound messages are logged before sending.
const std::string& logFileName ( ) const
inlinenoexcept
Returns
the Handler log file name.

The default value is HandlerLog.txt.

Definition at line 229 of file SessionSettings.h.

SessionSettings& logFileName ( const std::string &  value)

Specifies the Handler log file name.

unsigned messageGrouping ( ) const
inlinenoexcept
Returns
the message grouping mode.
  • 0 means default grouping - the messages are sent immediately, and pending messages (if any) are grouped till reaching of the TCP buffer size.
  • 1 means the messages are sent immediately and never grouped.
  • 2 (or higher) means the messages are sent immediately, and pending messages are grouped by 2 (or higher).

The default value is Default::MessageGrouping.

Definition at line 160 of file SessionSettings.h.

SessionSettings& messageGrouping ( unsigned  value)

Sets the message grouping mode.

SessionSettings& messagingSchemaVersion ( Messaging::SchemaVersion  schema)

Specifies the version of the message schema.

Allowed range is between Messaging::SchemaTraits::MinimalVersion - Messaging::SchemaTraits::Version. The default value is Messaging::SchemaTraits::Version.

Messaging::SchemaVersion messagingSchemaVersion ( ) const
inlinenoexcept
Returns
the version of the message schema.

Definition at line 519 of file SessionSettings.h.

unsigned reasonableTransmissionTime ( ) const
inlinenoexcept
Returns
the reasonable transmission time - as the percentage from the KeepAliveInterval value.

The default value is Default::ReasonableTransmissionTime.

Definition at line 379 of file SessionSettings.h.

SessionSettings& reasonableTransmissionTime ( unsigned  percentage)

Sets the reasonable transmission time - as the percentage from the KeepAliveInterval value.

unsigned receiveSpinningTimeout ( ) const
inlinenoexcept
Returns
the receive spinning timeout (microseconds).

The default value is Default::ReceiveSpinningTimeout.

Definition at line 132 of file SessionSettings.h.

SessionSettings& receiveSpinningTimeout ( unsigned  usecTimeout)

Sets the receive spinning timeout (microseconds).

unsigned reconnectAttempts ( ) const
inlinenoexcept
Returns
the maximum number of tries to restore the telecommunications link.

The default value is Default::ReconnectAttempts.

Definition at line 336 of file SessionSettings.h.

SessionSettings& reconnectAttempts ( unsigned  reconnectAttempts)

Sets the maximum number of tries to restore the telecommunications link.

unsigned reconnectInterval ( ) const
inlinenoexcept
Returns
the time interval between retries to restore the telecommunications link (seconds).

The default value is Default::ReconnectInterval.

Definition at line 348 of file SessionSettings.h.

SessionSettings& reconnectInterval ( unsigned  value)

Sets the time interval between retries to restore the telecommunications link (seconds).

Should not be zero.

bool reportNewMessagesWhileWaitingForMissedMessages ( ) const
inlinenoexcept
Returns
true if new messages are reported even when the message gap is detected, and the reply on the Retransmit Request message is expected; otherwise - false.

The default value is Default::ReportNewMessagesWhileWaitingForMissedMessages.

Definition at line 492 of file SessionSettings.h.

SessionSettings& reportNewMessagesWhileWaitingForMissedMessages ( bool  report)

Sets the option to report new messages even when the message gap is detected, and the reply on the Retransmit Request message is expected.

SessionSettings& resetToDefaults ( )

Resets the settings to the default values.

unsigned sendSpinningTimeout ( ) const
inlinenoexcept
Returns
the send spinning timeout (microseconds).

The default value is Default::SendSpinningTimeout.

Definition at line 144 of file SessionSettings.h.

SessionSettings& sendSpinningTimeout ( unsigned  usecTimeout)

Sets the send spinning timeout (microseconds).

Messaging::SessionID sessionId ( ) const
inlinenoexcept
Returns
the session id that was assigned by the exchange.

The default value is empty.

Definition at line 48 of file SessionSettings.h.

SessionSettings& sessionId ( Messaging::SessionID  value)

Sets the session id that was assigned by the exchange.

int socketReceiveBufferSize ( ) const
inlinenoexcept
Returns
the socket receive buffer size.

The default value is Default::SocketReceiveBufferSize.

Definition at line 364 of file SessionSettings.h.

SessionSettings& socketReceiveBufferSize ( int  bufferSize)

Sets the socket receive buffer size.

Parameters
bufferSizethe size of the socket receive buffer size. If SessionSettings::UseOsDefaultSocketBufferSize then the default operating system value is used.
int socketSendBufferSize ( ) const
inlinenoexcept
Returns
the size of the socket send buffer size.

The default value is Default::SocketSendBufferSize.

Definition at line 391 of file SessionSettings.h.

SessionSettings& socketSendBufferSize ( int  bufferSize)

Sets the size of the socket send buffer size.

Parameters
bufferSizethe size of the socket send buffer size. If SessionSettings::UseOsDefaultSocketBufferSize then the default operating system value is used.
const std::string& storageDirectory ( ) const
inlinenoexcept
Returns
the Session Storage directory.

Inbound and outbound messages, session's state data and the Handler log file are stored in this directory.

The default value is MsgStorage.

Definition at line 243 of file SessionSettings.h.

SessionSettings& storageDirectory ( const std::string &  value)

Sets the Session Storage directory.

Inbound and outbound messages, session's state data and the Handler log file are stored in this directory.

bool tcpNoDelayOption ( ) const
inlinenoexcept
Returns
the value of the option to improve latency at the expense of message throughput (the TCP_NODELAY socket option).

The default value is Default::TcpNoDelayOption.

Definition at line 436 of file SessionSettings.h.

SessionSettings& tcpNoDelayOption ( bool  value)

Sets the value of the option to improve latency at the expense of message throughput (the TCP_NODELAY socket option).

ThreadingModel::Enum threadingModel ( ) const
inlinenoexcept
Returns
the threading model.

The default value is Default::ThreadingModelValue.

Definition at line 120 of file SessionSettings.h.

SessionSettings& threadingModel ( ThreadingModel::Enum  value)

Sets the threading model.

const CpuIndexes& threadPoolAffinity ( ) const
inlinenoexcept
Returns
the thread pool affinity.

Definition at line 404 of file SessionSettings.h.

SessionSettings& threadPoolAffinity ( const CpuIndexes cpuIndexes)

Sets the thread pool affinity.

int threadPoolPolicy ( ) const
inlinenoexcept
Returns
the thread pool policy.

Definition at line 424 of file SessionSettings.h.

SessionSettings& threadPoolPolicy ( int  policy)

Sets the thread pool policy.

int threadPoolPriority ( ) const
inlinenoexcept
Returns
the thread pool priority.

Definition at line 414 of file SessionSettings.h.

SessionSettings& threadPoolPriority ( int  priority)

Sets the thread pool priority.

unsigned threadPoolSize ( ) const
inlinenoexcept
Returns
the size of the shared thread pool.

The default value is Default::ThreadPoolSize.

Definition at line 448 of file SessionSettings.h.

SessionSettings& threadPoolSize ( unsigned  numberOfThreads)

Sets the size of the shared thread pool.

std::string toString ( ) const
Returns
the human-friendly description.
const std::string& tradingSystemName ( ) const
inlinenoexcept
Returns
the trading system name.

The default value is empty.

Definition at line 96 of file SessionSettings.h.

SessionSettings& tradingSystemName ( const std::string &  value)

Sets the trading system name.

const std::string& tradingSystemVersion ( ) const
inlinenoexcept
Returns
the trading system version.

The default value is empty.

Definition at line 108 of file SessionSettings.h.

SessionSettings& tradingSystemVersion ( const std::string &  value)

Sets the trading system version.

bool useSpinLock ( ) const
inlinenoexcept
Returns
the value of the option to use spin lock.

The default value is false.

Definition at line 527 of file SessionSettings.h.

SessionSettings& useSpinLock ( bool  value)

Sets the value of the option to the option to use spin lock.

Member Data Documentation

const int UseOsDefaultSocketBufferSize = -1
static

Specifies the usage of the operating system default socket buffer size.

Definition at line 358 of file SessionSettings.h.


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