Hyper API for C++  0.0.16638
Hyper client library for C++ applications
hyperapi::Timestamp Class Referencefinal

A timestamp data value. More...

#include <Timestamp.hpp>

Public Member Functions

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

Friends

bool operator== (const Timestamp &lhs, const Timestamp &rhs) noexcept
 Equality operator.
 
bool operator> (const Timestamp &lhs, const Timestamp &rhs) noexcept
 Greater operator.
 
bool operator!= (const Timestamp &a, const Timestamp &b) noexcept
 Not equal operator.
 
bool operator< (const Timestamp &a, const Timestamp &b) noexcept
 Less than operator.
 
bool operator<= (const Timestamp &a, const Timestamp &b) noexcept
 Less than or equal operator.
 
bool operator>= (const Timestamp &a, const Timestamp &b) noexcept
 Greater or equal operator.
 
std::ostream & operator<< (std::ostream &os, const Timestamp &obj)
 Stream output operator.
 

Detailed Description

A timestamp data value.

Definition at line 16 of file Timestamp.hpp.

Constructor & Destructor Documentation

◆ Timestamp()

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.

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: