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.
Time::Time |
( |
unsigned |
hours, |
|
|
unsigned |
minutes |
|
) |
| |
Constructs the Time object.
- Parameters
-
[in] | hours | The hours |
[in] | minutes | The minutes |
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". |
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.
bool Time::isMorningTime |
( |
| ) |
|
Determines if the Time is a morning time.
A Time is said to be a morning time if its hours value lies in the range [0,12].
- Returns
- True if morning time, False otherwise.
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
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
Time & Time::operator= |
( |
const Time & |
other | ) |
|
Assigns a time object to this.
- Parameters
-
[in] | other | The object that is assigned |
- Returns
- this Time object
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
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
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
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/timetabler/checkouts/v0.3.0/include/fields/slot.h
- /home/docs/checkouts/readthedocs.org/user_builds/timetabler/checkouts/v0.3.0/src/fields/slot.cpp