OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
SessionScheduler.h
Go to the documentation of this file.
1/*
2* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3*
4* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5* and international copyright treaties.
6*
7* Access to and use of the software is governed by the terms of the applicable OnixS Software
8* Services Agreement (the Agreement) and Customer end user license agreements granting
9* a non-assignable, non-transferable and non-exclusive license to use the software
10* for it's own data processing purposes under the terms defined in the Agreement.
11*
12* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13* of this source code or associated reference material to any other location for further reproduction
14* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15*
16* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17* the terms of the Agreement is a violation of copyright law.
18*/
19
20#pragma once
21
22#include <string>
23#include <set>
24
25#include <OnixS/FIXEngine/ABI.h>
26
28
29namespace OnixS {
30namespace FIX {
32
33namespace Scheduling {
35
39
40typedef std::string SessionScheduleId;
41typedef std::string SessionConnectionSettingsId;
42
44class
47{
48public:
56 virtual
57 void
59 const SessionScheduler & scheduler,
60 Session * session,
61 bool * allowLogout) = 0;
62
67 virtual
68 void
73
76 virtual
77 void
79 const SessionScheduler & scheduler,
80 Session * session,
81 const std::string & warningReason) = 0;
82
85 virtual
86 void
88 const SessionScheduler & scheduler,
89 Session * session,
90 const std::string & errorReason) = 0;
91
92protected:
95 virtual ~SessionSchedulerListener() = default;
96};
97
100{
109
112
115 ONIXS_FIXENGINE_API static Enum parse(const std::string & fromText);
116};
117
120class
123{
124public:
127
130
132 const std::string & configurationFile() const;
133
139 void configurationFile(const std::string & file);
140
143
146
149
152
153private:
154 std::string * configurationFile_;
155 SessionSchedulerListener * eventListener_;
156 SchedulerThreadingModel::Enum threadingModel_;
157};
158
164{
165public:
179 const SessionSchedulerOptions & options);
180
183
188 const
191
196 const
199 const SessionConnectionSettingsId & id) const;
200
218 void
220 Session * session,
221 const SessionSchedule & schedule,
222 const SessionConnectionSettings & connection);
223
237 void
239 Session * session,
240 const SessionScheduleId & scheduleId,
241 const SessionConnectionSettingsId & connectionId);
242
245 void remove(Session * session);
246
249 bool isScheduled(Session * session);
250
256
261
266
270 void reconnectAttempts(int value);
271
276 int reconnectAttempts() const;
277
281 void reconnectInterval(int value);
282
287 int reconnectInterval() const;
288
292 void utcTimeUsage(bool value);
293
298 bool utcTimeUsage() const;
299
300private:
301 class Impl;
302 Impl * impl_;
303};
304}
305}
306}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
The collection of connection-related attributes for the session.
SessionScheduler events notifications.
virtual void onWarning(const SessionScheduler &scheduler, Session *session, const std::string &warningReason)=0
virtual void onError(const SessionScheduler &scheduler, Session *session, const std::string &errorReason)=0
virtual void onLoggingOut(const SessionScheduler &scheduler, Session *session, bool *allowLogout)=0
virtual void onInitiatorConnecting(const SessionScheduler &, Session *, const Counterparty &)
SchedulerThreadingModel::Enum threadingModel() const
The threading model.
const std::string & configurationFile() const
The path to the scheduler configuration file.
SessionSchedulerListener * eventListener() const
An instance of the event listener to notify about events.
void configurationFile(const std::string &file)
void threadingModel(SchedulerThreadingModel::Enum threadingModel)
Updates the threading model.
SessionSchedulerOptions()
Initializes parameters with default values.
void eventListener(SessionSchedulerListener *listener)
Associates the given event listener with the scheduler.
SessionScheduler(const SessionSchedulerOptions &options)
void add(Session *session, const SessionSchedule &schedule, const SessionConnectionSettings &connection)
void add(Session *session, const SessionScheduleId &scheduleId, const SessionConnectionSettingsId &connectionId)
void serviceThreadAffinity(const OnixS::Threading::CpuIndexes &cpuIndexes)
const SessionConnectionSettings * findConnectionSettings(const SessionConnectionSettingsId &id) const
~SessionScheduler()
Performs the graceful shutdown of scheduling services.
const SessionSchedule * findSchedule(const SessionScheduleId &id) const
const OnixS::Threading::CpuIndexes & serviceThreadAffinity() const
ONIXS_FIXENGINE_API_DECL(class, SessionScheduler)
std::string SessionConnectionSettingsId
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)
std::set< CpuIndex > CpuIndexes
Definition Thread.h:32
The way in which the Scheduler will utilize threads.
@ DedicatedThreads
Scheduler will use its own threads.
@ ExternalThread
Scheduler events are handled by rolling an event loop in a user thread.
static ONIXS_FIXENGINE_API Enum parse(const std::string &fromText)
static ONIXS_FIXENGINE_API const char * toString(SchedulerThreadingModel::Enum value)
Returns the textual representation of the SchedulerThreadingModel::Enum value.