OnixS C++ ICE Binary Order Entry Handler 1.0.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 <OnixS/ICE/BOE/ABI.h>
23
24#include <string>
25#include <vector>
26
28namespace Scheduling {
29
32{
44
46 static Enum parse(const std::string & value);
47
49 static std::string toString(Enum value);
50
52 static Enum now();
53
55 static Enum utcNow();
56};
57
59typedef int Hours;
60
62typedef int Minutes;
63
65typedef int Seconds;
66
69{
70public:
71 TimeOfDay() noexcept;
72
74
76 Hours hours() const noexcept;
77
79 Minutes minutes() const noexcept;
80
82 Seconds seconds() const noexcept;
83
85 Seconds sinceMidnight() const noexcept;
86
88 std::string toString() const;
89
91 bool operator == (const TimeOfDay & other) const noexcept;
92
94 bool operator != (const TimeOfDay & other) const noexcept;
95
97 static TimeOfDay now();
98
100 static TimeOfDay midnight() noexcept;
101
103 static TimeOfDay bad();
104
106 static TimeOfDay parse(const std::string &);
107
108private:
109 Seconds seconds_;
110
111 explicit TimeOfDay(Seconds) noexcept;
112};
113
114inline
116{
117 return seconds_;
118}
119
120inline
121bool TimeOfDay::operator == (const TimeOfDay & other) const noexcept
122{
123 return seconds_ == other.seconds_;
124}
125
126inline
127bool TimeOfDay::operator != (const TimeOfDay & other) const noexcept
128{
129 return seconds_ != other.seconds_;
130}
131
134
137{
138public:
149
151
156 TimeOfDay logonTime(DayOfWeek::Enum day) const noexcept;
157
160
165 TimeOfDay logoutTime(DayOfWeek::Enum day) const noexcept;
166
169
171 DayOfWeek::Enum resetDay() const noexcept;
172
173 SessionSchedule & operator = (const SessionSchedule & other);
174
175private:
177
178 TimeOfDayOfWeek logonTimes_;
179 TimeOfDayOfWeek logoutTimes_;
180
181 DayOfWeek::Enum startOfWeek_;
182};
183
184inline
186{
187 return logonTimes_[day];
188}
189
190inline
192{
193 logonTimes_[day] = logonTime;
194 return *this;
195}
196
197inline
199{
200 return logoutTimes_[day];
201}
202
203inline
205{
206 logoutTimes_[day] = logoutTime;
207 return *this;
208}
209
210inline
212{
213 return startOfWeek_;
214}
215}
#define ONIXS_ICEBOE_NAMESPACE_BEGIN
Definition ABI.h:94
#define ONIXS_ICEBOE_NAMESPACE_END
Definition ABI.h:98
#define ONIXS_ICEBOE_EXPORTED
Definition Compiler.h:153
DayOfWeek::Enum resetDay() const noexcept
TimeOfDay logoutTime(DayOfWeek::Enum day) const noexcept
TimeOfDay logonTime(DayOfWeek::Enum day) const noexcept
SessionSchedule(DayOfWeek::Enum firstDay, DayOfWeek::Enum lastDay, TimeOfDay logonTime, TimeOfDay logoutTime)
Constructor.
SessionSchedule(const SessionSchedule &other)
static TimeOfDay parse(const std::string &)
Parses the time of day from the given string presentation.
static TimeOfDay midnight() noexcept
Minutes minutes() const noexcept
Seconds seconds() const noexcept
int Minutes
The number of minutes.
int Hours
The number of hours.
TimeOfDay TimeOfDayOfWeek[DayOfWeek::Total]
Collection of time of day values indexed by the day of week.
int Seconds
The number of seconds.
static Enum parse(const std::string &value)
Transforms the string presentation into a valid constant.
static std::string toString(Enum value)