OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
Engine Class Reference

Public Member Functions

void log (const std::string &message)
int listenPort () const
const std::string & logDirectory () const
Timestamp licenseExpirationDate () const
Dictionaries dictionaries () const
void addSessionDictionary (const std::string &dictionaryFile)
void addSessionDictionaryFromString (const std::string &dialectString)
void addListenPort (int port, ISessionReactor *stack=ONIXS_FIXENGINE_NULLPTR)
void addListenPorts (const ListenPorts &ports, const ISessionReactors &stacks=ISessionReactors())
void removeListenPort (int port)
void removeListenPorts (const ListenPorts &ports)
void addSslListenPort (int port)
void addSslListenPorts (const ListenPorts &ports)
void removeSslListenPort (int port)
void removeSslListenPorts (const ListenPorts &ports)
void registerListener (IEngineListener *listener)
void unregisterListener ()
void synchronizeHighResolutionTimeServiceWithSystemTime ()
const EngineSettingssettings () const

Static Public Member Functions

static Engineinit (int listenPort=0, ISessionReactor *stack=ONIXS_FIXENGINE_NULLPTR)
static Engineinit (const std::string &configFile, ISessionReactor *stack=ONIXS_FIXENGINE_NULLPTR)
static Engineinit (const std::string &configFile, const ISessionReactors &stacks)
static EngineinitFromString (const std::string &configuration, ISessionReactor *stack=ONIXS_FIXENGINE_NULLPTR)
static EngineinitFromString (const std::string &configuration, const ISessionReactors &stacks)
static Engineinit (const EngineSettings &settings, ISessionReactor *stack=ONIXS_FIXENGINE_NULLPTR)
static Engineinit (const EngineSettings &settings, const ISessionReactors &stacks)
static void shutdown ()
static Engineinstance ()
static bool initialized ()

Detailed Description

Definition at line 40 of file Engine.h.

Member Function Documentation

◆ addListenPort()

void addListenPort ( int port,
ISessionReactor * stack = ONIXS_FIXENGINE_NULLPTR )

Adds the listen port(s) for incoming connections.

Parameters
portThe listen port(s) for incoming connections.
stackAn instance(s) of an externally managed reactor(s) for acceptor sessions and the given listen port(s).
Exceptions
Anexception if the FIX Engine cannot start listening on the specified port(s) or the telecommunication level is disabled (the Listen Port is -1 or 0).
Note
This call is thread-safe.

◆ addListenPorts()

void addListenPorts ( const ListenPorts & ports,
const ISessionReactors & stacks = ISessionReactors() )

◆ addSessionDictionary()

void addSessionDictionary ( const std::string & dictionaryFile)

Adds the session level dictionary(s) from the XML file(s) with the description of the FIX Dictionary(s).

Note
More than one file could be specified. The symbol '|' is used as the file name delimiter.
Parameters
dictionaryFileSpecifies the path(s) to the XML file(s) with the description of the FIX Dictionary(s).
Exceptions
TheOnixS::DomainException if there are standard dictionary(s) in the XML file(s).
Note
This call is thread-safe.

◆ addSessionDictionaryFromString()

void addSessionDictionaryFromString ( const std::string & dialectString)

Adds the session level dictionary(s) from the plain text string with the description of the FIX Dictionary(s).

Parameters
dialectStringSpecifies the plain text string with the description of the FIX Dictionary(s).
Exceptions
TheOnixS::DomainException if there are standard dictionary(s) in the dialect string.
Note
This call is thread-safe.

◆ addSslListenPort()

void addSslListenPort ( int port)

Adds the ssl listen port(s) for incoming ssl connections.

Exceptions
Anexception if the FIX Engine cannot start listening on the specified ssl port(s) or the telecommunication level is disabled (the Listen Port is -1 or 0).
Note
This call is thread-safe.

◆ addSslListenPorts()

void addSslListenPorts ( const ListenPorts & ports)

◆ dictionaries()

Dictionaries dictionaries ( ) const

Returns the array of loaded dictionaries.

◆ init() [1/5]

Engine * init ( const EngineSettings & settings,
const ISessionReactors & stacks )
static

◆ init() [2/5]

Engine * init ( const EngineSettings & settings,
ISessionReactor * stack = ONIXS_FIXENGINE_NULLPTR )
static

Initializes the FIX Engine.

Parameters
settingsEngine settings.
stackAn instance(s) of an externally managed reactor for acceptor sessions.
Note
This call is thread-safe.

◆ init() [3/5]

Engine * init ( const std::string & configFile,
const ISessionReactors & stacks )
static

◆ init() [4/5]

Engine * init ( const std::string & configFile,
ISessionReactor * stack = ONIXS_FIXENGINE_NULLPTR )
static

Initializes the FIX Engine.

Parameters
configFileThe configuration file.
stackAn instance(s) of an externally managed reactor for acceptor sessions.
Note
This call is thread-safe.

◆ init() [5/5]

Engine * init ( int listenPort = 0,
ISessionReactor * stack = ONIXS_FIXENGINE_NULLPTR )
static

Initializes the FIX Engine.

Parameters
listenPortThe engine listens on this port for incoming connections. If '0' then only session-initiators can be created. If '-1' then the telecommunication level is disabled and only the message parsing/assembling can be used.
stackAn instance of an externally managed reactor for acceptor sessions.
Note
This call is thread-safe.

◆ initFromString() [1/2]

Engine * initFromString ( const std::string & configuration,
const ISessionReactors & stacks )
static

◆ initFromString() [2/2]

Engine * initFromString ( const std::string & configuration,
ISessionReactor * stack = ONIXS_FIXENGINE_NULLPTR )
static

Initializes the FIX Engine.

Parameters
configurationThe configuration string.
stackAn instance(s) of an externally managed reactor for acceptor sessions.
Note
This call is thread-safe.

◆ initialized()

bool initialized ( )
static

Returns 'true' if the FIX Engine has been initialized, otherwise - 'false'.

Note
This call is thread-safe.

◆ instance()

Engine * instance ( )
static

Returns the Engine instance.

Exceptions
TheOnixS::DomainException if the FIX Engine has not been initialized yet.
Note
This call is thread-safe.

◆ licenseExpirationDate()

Timestamp licenseExpirationDate ( ) const

Returns the Engine's license expiration date.

◆ listenPort()

int listenPort ( ) const

Returns the listen port.

The FIX Engine listens on this port for incoming connections.

◆ log()

void log ( const std::string & message)

Logs the given user's message to FIX Engine's log file.

Note
This call is thread-safe.

◆ logDirectory()

const std::string & logDirectory ( ) const

Returns the Engine log directory.

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

◆ registerListener()

void registerListener ( IEngineListener * listener)

Registers the Engine listener.

Exceptions
Anexception if the listener is already registered.
Note
This call is thread-safe.

◆ removeListenPort()

void removeListenPort ( int port)

Removes the listen port(s) for incoming connections.

Exceptions
Anexception if the telecommunication level is disabled (the Listen Port is -1 or 0).
Note
This call is thread-safe.

◆ removeListenPorts()

void removeListenPorts ( const ListenPorts & ports)

◆ removeSslListenPort()

void removeSslListenPort ( int port)

Removes the ssl listen port(s) for incoming ssl connections.

Exceptions
Anexception if the telecommunication level is disabled (the Listen Port is -1 or 0).
Note
This call is thread-safe.

◆ removeSslListenPorts()

void removeSslListenPorts ( const ListenPorts & ports)

◆ settings()

const EngineSettings & settings ( ) const

Returns the current Engine-level settings.

◆ shutdown()

void shutdown ( )
static

Shutdowns the FIX Engine and releases all resources.

Note
This call is thread-safe.

◆ synchronizeHighResolutionTimeServiceWithSystemTime()

void synchronizeHighResolutionTimeServiceWithSystemTime ( )

Performs the synchronization of the high-resolution internal time service with the system time on the Windows OS.

On OSes less than Windows 8 and Windows Server 2012, the internal high-resolution time service, is based on the QueryPerformanceCounter API. This service is synchronized with the system time only once when an application is started, as a result, a time difference can occur in time. Therefore, for such old windows versions, it makes sense to synchronize the internal time service periodically (e.g. once per day) with the system time to avoid time drift issues.

Exceptions
Anexception if there is a session in the non-disconnected state.
Note
This call is thread-safe.
The method should be called when all sessions are disconnected to avoid time resynchronization side effects.

◆ unregisterListener()

void unregisterListener ( )

Unregisters the Engine listener.

Note
This call is thread-safe.