OnixS C++ CME iLink 3 Binary Order Entry Handler 1.18.9
API Documentation
Loading...
Searching...
No Matches
SessionScheduler Class Reference

Public Member Functions

 SessionScheduler (const SessionSchedulerOptions &options)
 ~SessionScheduler ()
const SessionSchedulefindSchedule (const SessionScheduleId &id) const
const SessionConnectionSettingsfindConnectionSettings (const SessionConnectionSettingsId &id) const
SessionScheduleradd (Session *session, const SessionSchedule &schedule, const SessionConnectionSettings &connection)
SessionScheduleradd (Session *session, const SessionScheduleId &scheduleId, const SessionConnectionSettingsId &connectionId)
SessionSchedulerremove (Session *session)
SessionSchedulerserviceThreadAffinity (const OnixS::CME::iLink3::CpuIndexes &cpuIndexes)
const OnixS::CME::iLink3::CpuIndexesserviceThreadAffinity () const noexcept
SessionSchedulerreconnectAttempts (int value)
int reconnectAttempts () const
SessionSchedulerreconnectInterval (int value)
int reconnectInterval () const
SessionSchedulerutcTimeUsage (bool value)
bool utcTimeUsage () const

Static Public Attributes

static const size_t TimeResolutionMs = 10

Detailed Description

Definition at line 92 of file SessionScheduler.h.

Constructor & Destructor Documentation

◆ SessionScheduler()

◆ ~SessionScheduler()

Performs the graceful shutdown of scheduling sessions.

Member Function Documentation

◆ add() [1/2]

SessionScheduler & add ( Session * session,
const SessionSchedule & schedule,
const SessionConnectionSettings & connection )

Adds the session to the automatic connection management.

  • If the session is being added during the active time frame, it will be connected immediately.
  • If the session is being registered during the inactive time frame and is in the active state, it will be disconnected.
  • If the session is already registered, an exception will be thrown.
Parameters
sessionthe instance of the session to be maintained.
scheduleSession's schedule.
connectionSession's connection settings.

◆ add() [2/2]

SessionScheduler & add ( Session * session,
const SessionScheduleId & scheduleId,
const SessionConnectionSettingsId & connectionId )

Adds the session to the automatic connection management.

  • If the session is being added during the active time frame, it will be connected immediately.
  • If the session is being registered during the inactive time frame and is in the active state, it will be disconnected.
  • If the session is already registered, and exception will be thrown.
Parameters
sessionthe instance of the session to be maintained.
scheduleIdthe ID of the predefined schedule.
connectionIdthe ID of the predefined connection settings.

◆ findConnectionSettings()

const SessionConnectionSettings * findConnectionSettings ( const SessionConnectionSettingsId & id) const

Looks for the predefined session connection settings associated with the given id that was specified in Scheduler's configuration file.

Returns
NULL if no settings are available for the given id.

◆ findSchedule()

const SessionSchedule * findSchedule ( const SessionScheduleId & id) const

Looks for the predefined session schedule associated with the given id that was specified in Scheduler's configuration file.

Returns
NULL if no schedule is available for the given id.

◆ reconnectAttempts() [1/2]

int reconnectAttempts ( ) const
Returns
the number of logon attempts in case of a logon failure.

The default value is 3.

◆ reconnectAttempts() [2/2]

SessionScheduler & reconnectAttempts ( int value)

Sets the number of logon attempts in case of a logon failure.

◆ reconnectInterval() [1/2]

int reconnectInterval ( ) const
Returns
the time interval between the logon attempts in case of a logon failure (in seconds).

The default value is 180 seconds.

◆ reconnectInterval() [2/2]

SessionScheduler & reconnectInterval ( int value)

Sets the time interval between the logon attempts in case of a logon failure (in seconds).

◆ remove()

SessionScheduler & remove ( Session * session)

Removes the session from the automatic connection management services.

◆ serviceThreadAffinity() [1/2]

const OnixS::CME::iLink3::CpuIndexes & serviceThreadAffinity ( ) const
noexcept
Returns
the CPU affinity for the Scheduler service thread.

◆ serviceThreadAffinity() [2/2]

SessionScheduler & serviceThreadAffinity ( const OnixS::CME::iLink3::CpuIndexes & cpuIndexes)

Sets the CPU affinity for the Scheduler service thread.

◆ utcTimeUsage() [1/2]

bool utcTimeUsage ( ) const
Returns
true if the UTC is used, otherwise - false.

The default value is false.

◆ utcTimeUsage() [2/2]

SessionScheduler & utcTimeUsage ( bool value)

Activates the UTC usage.

Member Data Documentation

◆ TimeResolutionMs

const size_t TimeResolutionMs = 10
static

Definition at line 95 of file SessionScheduler.h.