OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
SessionSchedule.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 <vector>
24
25#include <OnixS/FIXEngine/ABI.h>
26
27#if !defined (MINMAX_ABUSER)
28#define UNDEF_MINMAX_ABUSER
29#define MINMAX_ABUSER
30#endif
31
32namespace OnixS {
33namespace FIX {
34namespace Scheduling {
36struct
39 enum Enum {
44
47 };
48
50 static Enum parse(const std::string & value);
51
53 static std::string toString(Enum value);
54};
55
57struct
60 enum Enum {
64
68
72 };
73
75 static Enum parse(const std::string & value);
76
78 static std::string toString(Enum value);
79};
80
82struct
84 DayOfWeek {
95
97 static Enum parse(const std::string & value);
98
100 static std::string toString(Enum value);
101};
102
103// The alias of the number of hours.
104typedef int Hours;
105
106// The alias of the number of minutes.
107typedef int Minutes;
108
109// The alias of the number of seconds.
110typedef int Seconds;
111
114{
115public:
118
122 Hours hours,
124 Seconds = 0);
125
128
130 Hours hours() const;
131
134
137
139 Seconds sinceMidnight() const;
140
142 std::string toString() const;
143
145 bool operator == (const TimeOfDay & other) const;
146
148 bool operator != (const TimeOfDay & other) const;
149
150 // Reinitializes the instance from another one.
151 TimeOfDay & operator = (const TimeOfDay &);
152
154 static TimeOfDay now();
155
158
160 static TimeOfDay bad();
161
163 static TimeOfDay parse(const std::string &);
164
165private:
166 Seconds seconds_;
167
169};
170
171inline
174{
175 return seconds_;
176}
177
178inline
179bool
181 const TimeOfDay & other) const
182{
183 return seconds_ == other.seconds_;
184}
185
186inline
187bool
189 const TimeOfDay & other) const
190{
191 return seconds_ != other.seconds_;
192}
193
196
201{
202public:
235 DayOfWeek::Enum firstDay,
236 DayOfWeek::Enum lastDay,
240 SequenceNumberResetPolicy::Enum seqNumberResetPolicy);
241
244
250
252 void logonTime(DayOfWeek::Enum day, TimeOfDay time);
253
259
261 void logoutTime(DayOfWeek::Enum day, TimeOfDay time);
262
266
269
272
274 SessionSchedule & operator = (const SessionSchedule & other);
275
276 std::string toString() const;
277
278private:
280
281 TimeOfDayOfWeek logonTimes_;
282 TimeOfDayOfWeek logoutTimes_;
283
284 SessionDuration::Enum sessionDuration_;
285 SequenceNumberResetPolicy::Enum seqNumberResetPolicy_;
286
287 DayOfWeek::Enum startOfWeek_;
288 DayOfWeek::Enum endOfWeek_;
289};
290
291inline
294{
295 return logonTimes_[day];
296}
297
298inline
299void
302{
303 logonTimes_[day] = logonTime;
304}
305
306inline
309{
310 return logoutTimes_[day];
311}
312
313inline
314void
317{
318 logoutTimes_[day] = logoutTime;
319}
320
321inline
324{
325 return sessionDuration_;
326}
327
328inline
331{
332 return seqNumberResetPolicy_;
333}
334
335inline
338{
339 return startOfWeek_;
340}
341}
342}
343}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
TimeOfDay logonTime(DayOfWeek::Enum day) const
The logon time for the session for the given day.
DayOfWeek::Enum sequenceNumberWeeklyResetDay() const
The day of the week on which the session message sequence numbers are reset.
TimeOfDay logoutTime(DayOfWeek::Enum day) const
The logout time for the session for the given day.
SessionSchedule(const SessionSchedule &other)
Initializes a clone of the given instance.
SessionDuration::Enum sessionDuration() const
Defines whether the session continues the entire week or an activity time frame is limited for the si...
SessionSchedule(DayOfWeek::Enum firstDay, DayOfWeek::Enum lastDay, TimeOfDay logonTime, TimeOfDay logoutTime, SessionDuration::Enum sessionDuration, SequenceNumberResetPolicy::Enum seqNumberResetPolicy)
Initializes the session schedule according to the given parameters.
SequenceNumberResetPolicy::Enum sequenceNumberResetPolicy() const
Defines the session sequence number reset policy.
Represents the time of the day.
bool operator!=(const TimeOfDay &other) const
Checks whether the instance is unequal to another one.
std::string toString() const
Builds the string presentation.
TimeOfDay(const TimeOfDay &)
Initializes from another instance.
static TimeOfDay midnight()
The 'Zero' point of the time of the day.
static TimeOfDay parse(const std::string &)
Parses the time of day from its string presentation.
TimeOfDay(Hours hours, Minutes minutes, Seconds=0)
Initializes an instance to a specified number of hours, minutes, and seconds.
static TimeOfDay now()
Returns the current time of the day value.
TimeOfDay()
The default initialization.
Seconds sinceMidnight() const
Gets the total number of seconds since the midnight.
static TimeOfDay bad()
An instance of the ill-formed time of the day.
bool operator==(const TimeOfDay &other) const
Checks whether the instance is equal to another one.
Hours hours() const
Gets hours of the time of the day.
Seconds seconds() const
Gets the seconds component of the time of the day.
Minutes minutes() const
Gets minutes of the time of the day.
TimeOfDay TimeOfDayOfWeek[DayOfWeek::Total]
The collection of the time of day values indexed by the day of the week.
Specifies a day of the week.
static Enum parse(const std::string &value)
Transforms the string presentation into a valid constant.
static std::string toString(Enum value)
Builds the string presentation for a given constant.
Defines the session sequence number reset policy.
static Enum parse(const std::string &value)
Transforms the string presentation into a valid constant.
@ Weekly
The session sequence number reset is performed once per week.
@ Daily
The session sequence number reset is performed on daily basis.
@ Never
The session sequence number must never be reset by scheduling services.
static std::string toString(Enum value)
Builds the string presentation for a given constant.
Specifies an activity time frame for the session.
static Enum parse(const std::string &value)
Transforms the string presentation into a valid constant.
@ Day
The session continues not more than 24 hours.
@ Week
The session logon/logout occurs only once per week.
static std::string toString(Enum value)
Builds the string presentation for a given constant.