Timetabler
slot.h
Go to the documentation of this file.
1 
3 #ifndef SLOT_H
4 #define SLOT_H
5 
6 #include <vector>
7 #include <string>
8 #include "fields/field.h"
9 #include "fields/is_minor.h"
10 #include "global.h"
11 
15 enum class Day {
16  Monday,
17  Tuesday,
18  Wednesday,
19  Thursday,
20  Friday,
21  Saturday,
22  Sunday
23 };
24 
30 class Time {
31 private:
35  unsigned hours;
39  unsigned minutes;
40 public:
41  Time(unsigned, unsigned);
42  Time(std::string);
43  Time& operator=(const Time&);
44  bool operator==(const Time&);
45  bool operator<(const Time&);
46  bool operator<=(const Time&);
47  bool operator>=(const Time&);
48  bool operator>(const Time&);
49  std::string getTimeString();
50  bool isMorningTime();
51 };
52 
53 
59 class SlotElement {
60 private:
64  Time startTime, endTime;
68  Day day;
69 public:
70  SlotElement(Time&, Time&, Day);
71  bool isIntersecting(SlotElement &other);
72  bool isMorningSlotElement();
73 };
74 
75 
82 class Slot : public Field {
83 private:
87  std::string name;
92  IsMinor isMinor;
96  std::vector<SlotElement> slotElements;
97 public:
98  Slot(std::string, IsMinor, std::vector<SlotElement>);
99  bool operator==(const Slot &other);
100  bool isIntersecting(Slot &other);
101  void addSlotElements(SlotElement);
102  bool isMinorSlot();
103  FieldType getType();
104  std::string getTypeName();
105  std::string getName();
106  bool isMorningSlot();
107 };
108 
109 #endif
Class for "is minor".
Definition: is_minor.h:33
Class for a slot element.
Definition: slot.h:59
Class for a field.
Definition: field.h:14
Class for a time unit.
Definition: slot.h:30
Day
Enum Class to represent a day of the week.
Definition: slot.h:15
FieldType
Enum that represents all the field types.
Definition: global.h:10
Class for a slot.
Definition: slot.h:82