Stride Reference Manual  1.0
DaysOffSchool.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2017, Willem L, Kuylen E, Stijven S & Broeckhove J
14  */
15 
21 #include "DaysOffInterface.h"
22 
23 namespace stride {
24 
29 public:
31  DaysOffSchool(std::shared_ptr <Calendar> cal) : m_calendar(cal) {}
32 
34  bool isWorkOff() override {
35  return m_calendar->isWeekend() || m_calendar->isHoliday();
36  }
37 
39  virtual bool isSchoolOff() override { return true; }
40 
41 private:
42  std::shared_ptr <Calendar> m_calendar;
43 };
44 
45 }
46 
virtual bool isSchoolOff() override
See DaysOffInterface.
Definition: DaysOffSchool.h:39
Schools closed.
Definition: DaysOffSchool.h:28
Interface definition.
Time Dependent Person DataType.
Definition: NoBehaviour.h:17
DaysOffSchool(std::shared_ptr< Calendar > cal)
Initialize calendar.
Definition: DaysOffSchool.h:31
bool isWorkOff() override
See DaysOffInterface.
Definition: DaysOffSchool.h:34
Interface for DaysOff classes.
std::shared_ptr< Calendar > m_calendar
Management of calendar.
Definition: DaysOffSchool.h:42