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

A timestamp data value. More...

#include <Timestamp.hpp>

Classes

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

Public Member Functions

 Timestamp () noexcept
 Default constructor.
 
 Timestamp (Date date, Time time) noexcept
 Creates a timestamp value with a date and a time component.
 
 Timestamp (hyper_timestamp_t rawTimestamp, raw_t) noexcept
 Creates a timestamp from a raw timestamp value encoded as microseconds since 1 January 4713 BC.
 
const DategetDate () const noexcept
 Gets the date component of the timestamp.
 
const TimegetTime () const noexcept
 Gets the time component of the timestamp.
 
hyper_timestamp_t getRaw () const noexcept
 Gets the raw timestamp value encoded as microseconds since 1 January 4713 BC.
 
std::string toString () const
 Returns a string representation for debugging.
 

Detailed Description

A timestamp data value.

Definition at line 16 of file Timestamp.hpp.


Class Documentation

◆ hyperapi::Timestamp::raw_t

struct hyperapi::Timestamp::raw_t

Marker struct for the raw timestamp constructor.

Definition at line 21 of file Timestamp.hpp.

Constructor & Destructor Documentation

◆ Timestamp() [1/3]

hyperapi::Timestamp::Timestamp ( )
inlinenoexcept

Default constructor.

Definition at line 26 of file Timestamp.hpp.

◆ Timestamp() [2/3]

hyperapi::Timestamp::Timestamp ( Date  date,
Time  time 
)
noexcept

Creates a timestamp value with a date and a time component.

Parameters
dateThe date component.
timeThe time component.

◆ Timestamp() [3/3]

hyperapi::Timestamp::Timestamp ( hyper_timestamp_t  rawTimestamp,
raw_t   
)
explicitnoexcept

Creates a timestamp from a raw timestamp value encoded as microseconds since 1 January 4713 BC.

Parameters
rawTimestampThe raw timestamp value.

Member Function Documentation

◆ getDate()

const Date & hyperapi::Timestamp::getDate ( ) const
noexcept

Gets the date component of the timestamp.

Returns
The date component.

◆ getRaw()

hyper_timestamp_t hyperapi::Timestamp::getRaw ( ) const
noexcept

Gets the raw timestamp value encoded as microseconds since 1 January 4713 BC.

Returns
The raw timestamp value.

◆ getTime()

const Time & hyperapi::Timestamp::getTime ( ) const
noexcept

Gets the time component of the timestamp.

Returns
The time component.

◆ toString()

std::string hyperapi::Timestamp::toString ( ) const

Returns a string representation for debugging.

The returned string is in the format <date> <time>, where <date> is formatted as ±YYYY-MM-DD and <time> as HH:MM:SS.ssssss.


The documentation for this class was generated from the following file: