ARTS 2.5.11 (git: 6827797f)
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 25 of file artstime.h.

Member Typedef Documentation

◆ InternalTimeStep

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

Definition at line 27 of file artstime.h.

Constructor & Destructor Documentation

◆ Time() [1/4]

Time::Time ( )
inline

Definition at line 33 of file artstime.h.

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

◆ Time() [2/4]

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

Definition at line 34 of file artstime.h.

◆ Time() [3/4]

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

Definition at line 36 of file artstime.h.

◆ Time() [4/4]

Time::Time ( const String t)
explicit

Definition at line 14 of file artstime.cc.

Member Function Documentation

◆ EpochTime()

InternalTimeStep Time::EpochTime ( ) const
inline

Definition at line 62 of file artstime.h.

References time.

Referenced by next_even().

◆ operator Numeric()

Time::operator Numeric ( ) const
inlineexplicit

Definition at line 114 of file artstime.h.

References Seconds().

◆ operator!=()

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

Definition at line 72 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 95 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 85 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 99 of file artstime.h.

References Time().

◆ operator-() [2/2]

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

Definition at line 67 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 90 of file artstime.h.

References time.

◆ operator<()

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

Definition at line 70 of file artstime.h.

References time.

Referenced by operator<=().

◆ operator<=()

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

Definition at line 75 of file artstime.h.

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

Referenced by operator>().

◆ operator==()

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

Definition at line 71 of file artstime.h.

References time.

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

◆ operator>()

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

Definition at line 78 of file artstime.h.

References operator<=().

Referenced by operator>=().

◆ operator>=()

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

Definition at line 81 of file artstime.h.

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

◆ PartOfSecond()

Numeric Time::PartOfSecond ( ) const
inline

Definition at line 109 of file artstime.h.

References Seconds().

Referenced by seconds_into_day().

◆ Seconds() [1/2]

Numeric Time::Seconds ( ) const
inline

Definition at line 104 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 108 of file artstime.h.

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

Referenced by Seconds().

◆ seconds_into_day()

TimeStep Time::seconds_into_day ( ) const
inline

Definition at line 57 of file artstime.h.

References PartOfSecond(), and toStruct().

◆ toGMTStruct()

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

Definition at line 50 of file artstime.h.

References ARTS_USER_ERROR_IF, and toTimeT().

Referenced by LocalTimeOffset().

◆ toStruct()

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

Definition at line 43 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 40 of file artstime.h.

References time.

Referenced by toGMTStruct(), and toStruct().

◆ Version()

Index Time::Version ( ) const
inlinenoexcept

Definition at line 30 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 86 of file artstime.cc.

◆ operator>>

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

Definition at line 104 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: