00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if !defined(__ONIXS_FIXENGINE_SCHEDULING_SESSIONSCHEDULER_H__)
00021 #define __ONIXS_FIXENGINE_SCHEDULING_SESSIONSCHEDULER_H__
00022
00023 #include <string>
00024
00025 #include "OnixS/FIX/ABI.h"
00026
00027 namespace OnixS
00028 {
00029 namespace FIX
00030 {
00031 ONIXS_FIXENGINE_API_DECL(class, Session);
00032
00033 namespace Scheduling
00034 {
00035 ONIXS_FIXENGINE_API_DECL(class, SessionScheduler);
00036
00037 ONIXS_FIXENGINE_API_DECL(class, SessionSchedule);
00038 ONIXS_FIXENGINE_API_DECL(class, SessionConnectionSettings);
00039
00040 typedef std::string SessionScheduleId;
00041 typedef std::string SessionConnectionSettingsId;
00042
00044 class
00045 ONIXS_FIXENGINE_API
00046 SessionSchedulerListener
00047 {
00048 public:
00056 virtual void onLoggingOut(
00057 const SessionScheduler& scheduler,
00058 Session* session,
00059 bool* allowLogout) = 0;
00060
00063 virtual void onWarning(
00064 const SessionScheduler& scheduler,
00065 Session* session,
00066 const std::string& warningReason) = 0;
00067
00070 virtual void onError(
00071 const SessionScheduler& scheduler,
00072 Session* session,
00073 const std::string& errorReason) = 0;
00074
00075 protected:
00078 virtual ~SessionSchedulerListener();
00079 };
00080
00083 class
00084 ONIXS_FIXENGINE_API
00085 SessionSchedulerOptions
00086 {
00087 public:
00089 SessionSchedulerOptions();
00090
00092 SessionSchedulerOptions(const SessionSchedulerOptions&);
00093
00095 ~SessionSchedulerOptions();
00096
00098 const std::string& configurationFile() const;
00099
00101 void configurationFile(const std::string& file);
00102
00104 SessionSchedulerListener* eventListener() const;
00105
00107 void eventListener(SessionSchedulerListener* listener);
00108
00110 SessionSchedulerOptions&
00111 operator =(const SessionSchedulerOptions& other);
00112
00113 private:
00114 std::string* configurationFile_;
00115 SessionSchedulerListener* eventListener_;
00116 };
00117
00122 class ONIXS_FIXENGINE_API SessionScheduler
00123 {
00124 public:
00131 SessionScheduler(const SessionSchedulerOptions& options);
00132
00134 ~SessionScheduler();
00135
00140 const SessionSchedule*
00141 findSchedule(const SessionScheduleId& id) const;
00142
00147 const SessionConnectionSettings*
00148 findConnectionSettings(const SessionConnectionSettingsId& id) const;
00149
00163 void add(
00164 Session* session,
00165 const SessionSchedule& schedule,
00166 const SessionConnectionSettings& connection);
00167
00181 void add(
00182 Session* session,
00183 const SessionScheduleId& scheduleId,
00184 const SessionConnectionSettingsId& connectionId);
00185
00188 void remove(Session* session);
00189
00190 private:
00191 class Impl;
00192 Impl* impl_;
00193 };
00194 }
00195 }
00196 }
00197
00198 #endif // __ONIXS_FIXENGINE_SCHEDULING_SESSIONSCHEDULER_H__