Timetabler
slot.h
Go to the documentation of this file.
1 
3 #ifndef SLOT_H
4 #define SLOT_H
5 
6 #include <string>
7 #include <vector>
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 
41  public:
42  Time(unsigned, unsigned);
43  Time(std::string);
44  Time &operator=(const Time &);
45  bool operator==(const Time &);
46  bool operator<(const Time &);
47  bool operator<=(const Time &);
48  bool operator>=(const Time &);
49  bool operator>(const Time &);
50  std::string getTimeString();
51  bool isMorningTime();
52 };
53 
59 class SlotElement {
60  private:
64  Time startTime, endTime;
68  Day day;
69 
70  public:
71  SlotElement(Time &, Time &, Day);
72  bool isIntersecting(SlotElement &other);
73  bool isMorningSlotElement();
74 };
75 
82 class Slot : public Field {
83  private:
87  std::string name;
92  IsMinor isMinor;
96  std::vector<SlotElement> slotElements;
97 
98  public:
99  Slot(std::string, IsMinor, std::vector<SlotElement>);
100  bool operator==(const Slot &other);
101  bool isIntersecting(Slot &other);
102  void addSlotElements(SlotElement);
103  bool isMinorSlot();
104  FieldType getType();
105  std::string getTypeName();
106  std::string getName();
107  bool isMorningSlot();
108 };
109 
110 #endif
Class for "is minor".
Definition: is_minor.h:32
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:9
Class for a slot.
Definition: slot.h:82