Stride Reference Manual  - generated for commit 9643b11
DaysOffSchool.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * any later version.
7  * The software is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License
12  * along with the software. If not, see <http://www.gnu.org/licenses/>.
13  *
14  * Copyright 2017, Kuylen E, Willem L, Broeckhove J
15  */
16 
22 #include "calendar/Calendar.h"
24 
25 namespace stride {
26 
31 {
32 public:
34  explicit DaysOffSchool(std::shared_ptr<Calendar> cal) : m_calendar(std::move(cal)) {}
35 
37  bool IsWorkOff() override { return m_calendar->IsWeekend() || m_calendar->IsHoliday(); }
38 
40  bool IsSchoolOff() override { return true; }
41 
42 private:
43  std::shared_ptr<Calendar> m_calendar;
44 };
45 
46 } // namespace stride
Schools closed.
Definition: DaysOffSchool.h:30
Interface definition.
bool IsWorkOff() override
See DaysOffInterface.
Definition: DaysOffSchool.h:37
Interface for DaysOff classes.
std::shared_ptr< Calendar > m_calendar
Management of calendar.
Definition: DaysOffSchool.h:43
STL namespace.
DaysOffSchool(std::shared_ptr< Calendar > cal)
Initialize calendar.
Definition: DaysOffSchool.h:34
Header file for the Calendar class.
bool IsSchoolOff() override
See DaysOffInterface.
Definition: DaysOffSchool.h:40
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28