Stride Reference Manual  1.0
DaysOffStandard.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, Willem L, Kuylen E, Stijven S & Broeckhove J
15  */
16 
22 #include "Calendar.h"
23 #include "DaysOffInterface.h"
24 
25 #include <memory>
26 
27 namespace stride {
28 
33 public:
35  DaysOffStandard(std::shared_ptr<Calendar> cal) : m_calendar(cal) {}
36 
38  bool isWorkOff() override {
39  return m_calendar->isWeekend() || m_calendar->isHoliday();
40  }
41 
43  virtual bool isSchoolOff() override {
44  return m_calendar->isWeekend() || m_calendar->isHoliday() || m_calendar->isSchoolHoliday();
45  }
46 
47 private:
48  std::shared_ptr<Calendar> m_calendar;
49 };
50 
51 }
52 
Standard situation for days off from work and school.
Header file for the Calendar class.
Interface definition.
Time Dependent Person DataType.
Definition: NoBehaviour.h:17
virtual bool isSchoolOff() override
See DaysOffInterface.
bool isWorkOff() override
See DaysOffInterface.
Interface for DaysOff classes.
DaysOffStandard(std::shared_ptr< Calendar > cal)
Initialize calendar.
std::shared_ptr< Calendar > m_calendar
Management of calendar.