userver: utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > > Class Template Reference
Loading...
Searching...
No Matches
utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > > Class Template Reference

Detailed Description

template<typename Rep, typename Period>
class utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >

Definition at line 77 of file time_of_day.hpp.

Public Types

using DurationType = std::chrono::duration<Rep, Period>
 

Public Member Functions

Duration arithmetic
constexpr TimeOfDay (DurationType) noexcept
 
template<typename ORep , typename OPeriod >
constexpr TimeOfDay (std::chrono::duration< ORep, OPeriod >) noexcept
 
constexpr TimeOfDay (std::string_view)
 
Comparison operators
constexpr bool operator== (const TimeOfDay &) const
 
constexpr bool operator!= (const TimeOfDay &) const
 
constexpr bool operator< (const TimeOfDay &) const
 
constexpr bool operator<= (const TimeOfDay &) const
 
constexpr bool operator> (const TimeOfDay &) const
 
constexpr bool operator>= (const TimeOfDay &) const
 

Accessors

constexpr std::chrono::hours Hours () const noexcept
 
constexpr std::chrono::minutes Minutes () const noexcept
 
constexpr std::chrono::seconds Seconds () const noexcept
 
constexpr DurationType Subseconds () const noexcept
 
constexpr DurationType SinceMidnight () const noexcept
 
static constexpr TimeOfDay FromHHMMInt (int)
 Create time of day from integer representation, e.g.1330 => 13:30.
 

Member Typedef Documentation

◆ DurationType

template<typename Rep , typename Period >
using utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::DurationType = std::chrono::duration<Rep, Period>

Definition at line 79 of file time_of_day.hpp.

Constructor & Destructor Documentation

◆ TimeOfDay() [1/3]

template<typename Rep , typename Period >
constexpr utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::TimeOfDay ( DurationType d)
explicitconstexprnoexcept

Definition at line 405 of file time_of_day.hpp.

◆ TimeOfDay() [2/3]

template<typename Rep , typename Period >
template<typename ORep , typename OPeriod >
constexpr utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::TimeOfDay ( std::chrono::duration< ORep, OPeriod > d)
explicitconstexprnoexcept

Definition at line 411 of file time_of_day.hpp.

◆ TimeOfDay() [3/3]

template<typename Rep , typename Period >
constexpr utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::TimeOfDay ( std::string_view str)
explicitconstexpr

Definition at line 416 of file time_of_day.hpp.

Member Function Documentation

◆ FromHHMMInt()

template<typename Rep , typename Period >
constexpr TimeOfDay< std::chrono::duration< Rep, Period > > utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::FromHHMMInt ( int hh_mm)
staticconstexpr

Create time of day from integer representation, e.g.1330 => 13:30.

Definition at line 505 of file time_of_day.hpp.

◆ Hours()

template<typename Rep , typename Period >
constexpr std::chrono::hours utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Hours ( ) const
constexprnoexcept
Returns
Hours since midnight

Definition at line 458 of file time_of_day.hpp.

◆ Minutes()

template<typename Rep , typename Period >
constexpr std::chrono::minutes utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Minutes ( ) const
constexprnoexcept
Returns
Minutes since midnight + Hours

Definition at line 464 of file time_of_day.hpp.

◆ operator!=()

template<typename Rep , typename Period >
constexpr bool utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::operator!= ( const TimeOfDay< std::chrono::duration< Rep, Period > > & rhs) const
constexpr

Definition at line 427 of file time_of_day.hpp.

◆ operator<()

template<typename Rep , typename Period >
constexpr bool utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::operator< ( const TimeOfDay< std::chrono::duration< Rep, Period > > & rhs) const
constexpr

Definition at line 433 of file time_of_day.hpp.

◆ operator<=()

template<typename Rep , typename Period >
constexpr bool utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::operator<= ( const TimeOfDay< std::chrono::duration< Rep, Period > > & rhs) const
constexpr

Definition at line 439 of file time_of_day.hpp.

◆ operator==()

template<typename Rep , typename Period >
constexpr bool utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::operator== ( const TimeOfDay< std::chrono::duration< Rep, Period > > & rhs) const
constexpr

Definition at line 421 of file time_of_day.hpp.

◆ operator>()

template<typename Rep , typename Period >
constexpr bool utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::operator> ( const TimeOfDay< std::chrono::duration< Rep, Period > > & rhs) const
constexpr

Definition at line 445 of file time_of_day.hpp.

◆ operator>=()

template<typename Rep , typename Period >
constexpr bool utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::operator>= ( const TimeOfDay< std::chrono::duration< Rep, Period > > & rhs) const
constexpr

Definition at line 451 of file time_of_day.hpp.

◆ Seconds()

template<typename Rep , typename Period >
constexpr std::chrono::seconds utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Seconds ( ) const
constexprnoexcept
Returns
Seconds since midnight + Hours + Minutes

Definition at line 475 of file time_of_day.hpp.

◆ SinceMidnight()

template<typename Rep , typename Period >
constexpr TimeOfDay< std::chrono::duration< Rep, Period > >::DurationType utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::SinceMidnight ( ) const
constexprnoexcept
Returns
Underlying duration representation

Definition at line 499 of file time_of_day.hpp.

◆ Subseconds()

template<typename Rep , typename Period >
constexpr TimeOfDay< std::chrono::duration< Rep, Period > >::DurationType utils::datetime::TimeOfDay< std::chrono::duration< Rep, Period > >::Subseconds ( ) const
constexprnoexcept
Returns
Fractional part of seconds since midnight + Hours + Minutes + Seconds up to resolution

Definition at line 488 of file time_of_day.hpp.


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