A time data value.
More...
#include <Time.hpp>
|
struct | raw_t |
| Marker struct for the raw timestamp constructor. More...
|
|
|
| Time () noexcept |
| Default constructor.
|
|
| Time (int8_t hour, std::int8_t minute, std::int8_t second, std::int32_t microsecond=0) noexcept |
| Creates a time value from separate time components.
|
|
| Time (hyper_time_t rawTime, raw_t) noexcept |
| Creates a time value from the number of microseconds since midnight.
|
|
std::int8_t | getHour () const noexcept |
| Gets the hour.
|
|
std::int8_t | getMinute () const noexcept |
| Gets the minute.
|
|
std::int8_t | getSecond () const noexcept |
| Gets the second.
|
|
std::int32_t | getMicrosecond () const noexcept |
| Gets the microsecond.
|
|
std::string | toString () const |
| Gets a string representation for debugging.
|
|
hyper_time_t | getRaw () const noexcept |
| Gets the raw time value encoded as microseconds since midnight.
|
|
A time data value.
Definition at line 18 of file Time.hpp.
◆ hyperapi::Time::raw_t
struct hyperapi::Time::raw_t |
Marker struct for the raw timestamp constructor.
Definition at line 23 of file Time.hpp.
◆ Time() [1/3]
Default constructor.
Definition at line 28 of file Time.hpp.
◆ Time() [2/3]
hyperapi::Time::Time |
( |
int8_t |
hour, |
|
|
std::int8_t |
minute, |
|
|
std::int8_t |
second, |
|
|
std::int32_t |
microsecond = 0 |
|
) |
| |
|
noexcept |
Creates a time value from separate time components.
- Parameters
-
hour | The hour. |
minute | The minute. |
second | The second. |
microsecond | The microsecond. |
- Precondition
hour
must be between 0 and 23, minute
and second
between 0 and 59, and microsecond
smaller than 1'000'000.
◆ Time() [3/3]
hyperapi::Time::Time |
( |
hyper_time_t |
rawTime, |
|
|
raw_t |
|
|
) |
| |
|
explicitnoexcept |
Creates a time value from the number of microseconds since midnight.
- Parameters
-
rawTime | The raw time value. |
◆ getHour()
std::int8_t hyperapi::Time::getHour |
( |
| ) |
const |
|
noexcept |
Gets the hour.
- Returns
- The hour.
◆ getMicrosecond()
std::int32_t hyperapi::Time::getMicrosecond |
( |
| ) |
const |
|
noexcept |
Gets the microsecond.
- Returns
- The microsecond.
◆ getMinute()
std::int8_t hyperapi::Time::getMinute |
( |
| ) |
const |
|
noexcept |
Gets the minute.
- Returns
- The minute.
◆ getRaw()
hyper_time_t hyperapi::Time::getRaw |
( |
| ) |
const |
|
noexcept |
Gets the raw time value encoded as microseconds since midnight.
- Returns
- The raw time value.
◆ getSecond()
std::int8_t hyperapi::Time::getSecond |
( |
| ) |
const |
|
noexcept |
Gets the second.
- Returns
- The second.
◆ toString()
std::string hyperapi::Time::toString |
( |
| ) |
const |
Gets a string representation for debugging.
- Returns
- the time in the 'HH:MM:SS.ssssss' format
The documentation for this class was generated from the following file: