Class for a time unit.
More...
#include <slot.h>
Class for a time unit.
This can represent the hours and minutes as a time unit.
Definition at line 30 of file slot.h.
◆ Time() [1/2]
Time::Time |
( |
unsigned |
hours, |
|
|
unsigned |
minutes |
|
) |
| |
Constructs the Time object.
- Parameters
-
[in] | hours | The hours |
[in] | minutes | The minutes |
Definition at line 15 of file slot.cpp.
◆ Time() [2/2]
Time::Time |
( |
std::string |
time | ) |
|
Constructs the Time object.
- Parameters
-
[in] | time | The time represented as a string in the 24 hour format. A valid input would be "12:30". |
Definition at line 26 of file slot.cpp.
◆ getTimeString()
std::string Time::getTimeString |
( |
| ) |
|
Gets the time as a string.
For example, 10 hours and 30 minutes is represented as "10:30".
- Returns
- The time string.
Definition at line 111 of file slot.cpp.
◆ isMorningTime()
bool Time::isMorningTime |
( |
| ) |
|
◆ operator<()
bool Time::operator< |
( |
const Time & |
other | ) |
|
Checks if a Time is strictly before another.
- Parameters
-
[in] | other | The Time object with which the comparison is being made |
- Returns
- True if the Time of this object is strictly before the other object, and False otherwise
Definition at line 64 of file slot.cpp.
◆ operator<=()
bool Time::operator<= |
( |
const Time & |
other | ) |
|
Checks if a Time is before or identical to another.
- Parameters
-
[in] | other | The Time object with which the comparison is being made |
- Returns
- True if this is before or identical to the other object, False otherwise
Definition at line 80 of file slot.cpp.
◆ operator=()
Time & Time::operator= |
( |
const Time & |
other | ) |
|
Assigns a time object to this.
- Parameters
-
[in] | other | The object that is assigned |
- Returns
- this Time object
Definition at line 38 of file slot.cpp.
◆ operator==()
bool Time::operator== |
( |
const Time & |
other | ) |
|
Checks if two Time objects are identical, which is whether they represent the same hours and minutes.
- Parameters
-
[in] | other | The Time object with which the comparison is being made |
- Returns
- True if identical, False otherwise
Definition at line 52 of file slot.cpp.
◆ operator>()
bool Time::operator> |
( |
const Time & |
other | ) |
|
Checks if a Time is strictly after another.
- Parameters
-
[in] | other | The Time object with which the comparison is being made |
- Returns
- True if the Time of this object is strictly after the other object, and False otherwise
Definition at line 102 of file slot.cpp.
◆ operator>=()
bool Time::operator>= |
( |
const Time & |
other | ) |
|
Checks if a Time is after or identical to another.
- Parameters
-
[in] | other | The Time object with which the comparison is being made |
- Returns
- True if this is after or identical to the other object, False otherwise
Definition at line 92 of file slot.cpp.
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/timetabler/checkouts/docs2/include/fields/slot.h
- /home/docs/checkouts/readthedocs.org/user_builds/timetabler/checkouts/docs2/src/fields/slot.cpp