Hyper API for C++ 0.0.20746
Hyper client library for C++ applications
Loading...
Searching...
No Matches
hyperapi::Time Class Referencefinal

A time data value. More...

#include <Time.hpp>

Classes

struct  raw_t
 Marker struct for the raw timestamp constructor. More...
 

Public Member Functions

 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.
 

Detailed Description

A time data value.

Definition at line 18 of file Time.hpp.


Class Documentation

◆ hyperapi::Time::raw_t

struct hyperapi::Time::raw_t

Marker struct for the raw timestamp constructor.

Definition at line 23 of file Time.hpp.

Constructor & Destructor Documentation

◆ Time() [1/3]

hyperapi::Time::Time ( )
inlinenoexcept

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
hourThe hour.
minuteThe minute.
secondThe second.
microsecondThe 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
rawTimeThe raw time value.

Member Function Documentation

◆ 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: