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

A time data value. More...

#include <Time.hpp>

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.
 
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.

Constructor & Destructor Documentation

◆ Time() [1/2]

hyperapi::Time::Time ( )
inlinenoexcept

Default constructor.

Definition at line 23 of file Time.hpp.

◆ Time() [2/2]

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.

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: