ARTS 2.5.9 (git: 825fa5f2)
Time Struct Reference

Class to handle time in ARTS. More...

#include <artstime.h>

Public Types

using InternalTimeStep = decltype(time)::duration
 

Public Member Functions

Index Version () const noexcept
 
 Time ()
 
 Time (std::time_t t)
 
 Time (std::tm t)
 
 Time (const String &t)
 
std::time_t toTimeT () const
 
std::tm toStruct () const
 
std::tm toGMTStruct () const
 
TimeStep seconds_into_day () const
 
InternalTimeStep EpochTime () const
 
InternalTimeStep operator- (const Time &t) const noexcept
 
bool operator< (const Time &t) const noexcept
 
bool operator== (const Time &t) const noexcept
 
bool operator!= (const Time &t) const noexcept
 
bool operator<= (const Time &t) const noexcept
 
bool operator> (const Time &t) const noexcept
 
bool operator>= (const Time &t) const noexcept
 
template<typename T , typename R >
Timeoperator+= (const std::chrono::duration< T, R > &dt)
 
template<typename T , typename R >
Timeoperator-= (const std::chrono::duration< T, R > &dt)
 
template<typename T , typename R >
Time operator+ (const std::chrono::duration< T, R > &dt) const
 
template<typename T , typename R >
Time operator- (const std::chrono::duration< T, R > &dt) const
 
Numeric Seconds () const
 
void Seconds (Numeric x)
 
Numeric PartOfSecond () const
 
 operator Numeric () const
 

Public Attributes

std::chrono::system_clock::time_point time
 

Friends

std::ostream & operator<< (std::ostream &os, const Time &t)
 
std::istream & operator>> (std::istream &is, Time &t)
 

Detailed Description

Class to handle time in ARTS.

Definition at line 43 of file artstime.h.

Member Typedef Documentation

◆ InternalTimeStep

using Time::InternalTimeStep = decltype(time)::duration

Definition at line 45 of file artstime.h.

Constructor & Destructor Documentation

◆ Time() [1/4]

Time::Time ( )
inline

Definition at line 51 of file artstime.h.

Referenced by operator+(), and operator-().

◆ Time() [2/4]

Time::Time ( std::time_t  t)
inlineexplicit

Definition at line 52 of file artstime.h.

◆ Time() [3/4]

Time::Time ( std::tm  t)
inlineexplicit

Definition at line 54 of file artstime.h.

◆ Time() [4/4]

Time::Time ( const String t)
explicit

Definition at line 32 of file artstime.cc.

Member Function Documentation

◆ EpochTime()

InternalTimeStep Time::EpochTime ( ) const
inline

Definition at line 80 of file artstime.h.

References time.

Referenced by next_even().

◆ operator Numeric()

Time::operator Numeric ( ) const
inlineexplicit

Definition at line 132 of file artstime.h.

References Seconds().

◆ operator!=()

bool Time::operator!= ( const Time t) const
inlinenoexcept

Definition at line 90 of file artstime.h.

References operator==().

◆ operator+()

template<typename T , typename R >
Time Time::operator+ ( const std::chrono::duration< T, R > &  dt) const
inline

Definition at line 113 of file artstime.h.

References Time().

◆ operator+=()

template<typename T , typename R >
Time & Time::operator+= ( const std::chrono::duration< T, R > &  dt)
inline

Definition at line 103 of file artstime.h.

References time.

Referenced by Seconds().

◆ operator-() [1/2]

template<typename T , typename R >
Time Time::operator- ( const std::chrono::duration< T, R > &  dt) const
inline

Definition at line 117 of file artstime.h.

References Time().

◆ operator-() [2/2]

InternalTimeStep Time::operator- ( const Time t) const
inlinenoexcept

Definition at line 85 of file artstime.h.

References time.

◆ operator-=()

template<typename T , typename R >
Time & Time::operator-= ( const std::chrono::duration< T, R > &  dt)
inline

Definition at line 108 of file artstime.h.

References time.

◆ operator<()

bool Time::operator< ( const Time t) const
inlinenoexcept

Definition at line 88 of file artstime.h.

References time.

Referenced by operator<=().

◆ operator<=()

bool Time::operator<= ( const Time t) const
inlinenoexcept

Definition at line 93 of file artstime.h.

References operator<(), and operator==().

Referenced by operator>().

◆ operator==()

bool Time::operator== ( const Time t) const
inlinenoexcept

Definition at line 89 of file artstime.h.

References time.

Referenced by operator!=(), operator<=(), and operator>=().

◆ operator>()

bool Time::operator> ( const Time t) const
inlinenoexcept

Definition at line 96 of file artstime.h.

References operator<=().

Referenced by operator>=().

◆ operator>=()

bool Time::operator>= ( const Time t) const
inlinenoexcept

Definition at line 99 of file artstime.h.

References operator==(), and operator>().

◆ PartOfSecond()

Numeric Time::PartOfSecond ( ) const
inline

Definition at line 127 of file artstime.h.

References Seconds().

Referenced by seconds_into_day().

◆ Seconds() [1/2]

Numeric Time::Seconds ( ) const
inline

Definition at line 122 of file artstime.h.

References time.

Referenced by IGRF::compute(), operator Numeric(), and PartOfSecond().

◆ Seconds() [2/2]

void Time::Seconds ( Numeric  x)
inline

Definition at line 126 of file artstime.h.

References operator+=(), and Seconds().

Referenced by Seconds().

◆ seconds_into_day()

TimeStep Time::seconds_into_day ( ) const
inline

Definition at line 75 of file artstime.h.

References PartOfSecond(), and toStruct().

◆ toGMTStruct()

std::tm Time::toGMTStruct ( ) const
inline

Definition at line 68 of file artstime.h.

References ARTS_USER_ERROR_IF, and toTimeT().

Referenced by LocalTimeOffset().

◆ toStruct()

std::tm Time::toStruct ( ) const
inline

Definition at line 61 of file artstime.h.

References ARTS_USER_ERROR_IF, and toTimeT().

Referenced by LocalTimeOffset(), and seconds_into_day().

◆ toTimeT()

std::time_t Time::toTimeT ( ) const
inline

Definition at line 58 of file artstime.h.

References time.

Referenced by toGMTStruct(), and toStruct().

◆ Version()

Index Time::Version ( ) const
inlinenoexcept

Definition at line 48 of file artstime.h.

Referenced by xml_write_to_stream().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Time t 
)
friend

Definition at line 104 of file artstime.cc.

◆ operator>>

std::istream & operator>> ( std::istream &  is,
Time t 
)
friend

Definition at line 122 of file artstime.cc.

Member Data Documentation

◆ time

std::chrono::system_clock::time_point Time::time

The documentation for this struct was generated from the following files: