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

An interval data value. More...

#include <Interval.hpp>

Public Member Functions

 Interval () noexcept
 Default constructor.
 
 Interval (std::int32_t years, std::int32_t months, std::int32_t days, std::int32_t hours, std::int32_t minutes, std::int32_t seconds, std::int32_t microseconds) noexcept
 Creates an interval value from a number of years, months, days, hours, minutes, seconds, and microseconds. More...
 
std::int32_t getYears () const noexcept
 Gets the number of years in the interval. More...
 
std::int32_t getMonths () const noexcept
 Gets the number of months in the interval. More...
 
std::int32_t getDays () const noexcept
 Gets the number of days in the interval. More...
 
std::int32_t getHours () const noexcept
 Gets the number of hours in the interval. More...
 
std::int32_t getMinutes () const noexcept
 Gets the number of minutes in the interval. More...
 
std::int32_t getSeconds () const noexcept
 Gets the number of seconds in the interval. More...
 
std::int32_t getMicroseconds () const noexcept
 Gets the number of microseconds in the interval. More...
 
std::string toString () const
 Gets a string representation for debugging. More...
 

Friends

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

Detailed Description

An interval data value.

Definition at line 18 of file Interval.hpp.

Constructor & Destructor Documentation

◆ Interval()

hyperapi::Interval::Interval ( std::int32_t  years,
std::int32_t  months,
std::int32_t  days,
std::int32_t  hours,
std::int32_t  minutes,
std::int32_t  seconds,
std::int32_t  microseconds 
)
noexcept

Creates an interval value from a number of years, months, days, hours, minutes, seconds, and microseconds.

Parameters
yearsThe years.
monthsThe months.
daysThe days.
hoursThe hours.
minutesThe minutes.
secondsThe seconds.
microsecondsThe microseconds.

Member Function Documentation

◆ getDays()

std::int32_t hyperapi::Interval::getDays ( ) const
noexcept

Gets the number of days in the interval.

Returns
The number of days.

◆ getHours()

std::int32_t hyperapi::Interval::getHours ( ) const
noexcept

Gets the number of hours in the interval.

Returns
The number of hours.

◆ getMicroseconds()

std::int32_t hyperapi::Interval::getMicroseconds ( ) const
noexcept

Gets the number of microseconds in the interval.

Returns
The number of microseconds.

◆ getMinutes()

std::int32_t hyperapi::Interval::getMinutes ( ) const
noexcept

Gets the number of minutes in the interval.

Returns
The number of minutes.

◆ getMonths()

std::int32_t hyperapi::Interval::getMonths ( ) const
noexcept

Gets the number of months in the interval.

Returns
The number of months.

◆ getSeconds()

std::int32_t hyperapi::Interval::getSeconds ( ) const
noexcept

Gets the number of seconds in the interval.

Returns
The number of seconds.

◆ getYears()

std::int32_t hyperapi::Interval::getYears ( ) const
noexcept

Gets the number of years in the interval.

Returns
The number of years.

◆ toString()

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

Gets a string representation for debugging.

Returns
the interval in the 'P<date>T<time>' format while date is in the'[n]Y[n]M[n]D' format and time is in the '[n]H[n]M[n]S' format. Elements that are 0 will be omitted.

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