tempoch-cpp 0.5.5
Header-only C++ wrapper for tempoch
Loading...
Searching...
No Matches
tempoch::Period< T > Class Template Reference

#include <tempoch/period.hpp>

Public Member Functions

 Period (const T &start, const T &end)
T start () const
T end () const
template<typename Target>
auto to () const
template<typename TargetA, typename TargetB>
auto to () const
template<typename Target>
auto to_with (const TimeContext &ctx) const
template<typename TargetA, typename TargetB>
auto to_with (const TimeContext &ctx) const
template<typename TargetType = qtty::DayTag>
qtty::Quantity< typename qtty::ExtractTag< TargetType >::type > duration () const
template<typename TargetType = qtty::DayTag>
qtty::Quantity< typename qtty::ExtractTag< TargetType >::type > length () const
 Returns the length of the period (primary name; duration() is a backward-compat alias).
Period intersection (const Period &other) const
bool contains (const T &point) const noexcept
std::vector< Period< T > > union_with (const Period< T > &other) const
std::vector< Period< T > > complement_of (const std::vector< Period< T > > &others) const
const tempoch_period_mjd_t & c_inner () const noexcept

Static Public Member Functions

static Period from_c (const tempoch_period_mjd_t &c)

Detailed Description

template<typename T = ModifiedJulianDate<scale::TT>>
class tempoch::Period< T >

Definition at line 92 of file period.hpp.

Constructor & Destructor Documentation

◆ Period()

template<typename T = ModifiedJulianDate<scale::TT>>
tempoch::Period< T >::Period ( const T & start,
const T & end )
inline

Construct a half-open interval [start, end).

The period is half-open: start is included, end is excluded.

Exceptions
InvalidPeriodErrorif start > end.

Definition at line 102 of file period.hpp.

Member Function Documentation

◆ c_inner()

template<typename T = ModifiedJulianDate<scale::TT>>
const tempoch_period_mjd_t & tempoch::Period< T >::c_inner ( ) const
inlinenoexcept

Definition at line 193 of file period.hpp.

◆ complement_of()

template<typename T = ModifiedJulianDate<scale::TT>>
std::vector< Period< T > > tempoch::Period< T >::complement_of ( const std::vector< Period< T > > & others) const
inline

Definition at line 176 of file period.hpp.

◆ contains()

template<typename T = ModifiedJulianDate<scale::TT>>
bool tempoch::Period< T >::contains ( const T & point) const
inlinenoexcept

Definition at line 160 of file period.hpp.

◆ duration()

template<typename T = ModifiedJulianDate<scale::TT>>
template<typename TargetType = qtty::DayTag>
qtty::Quantity< typename qtty::ExtractTag< TargetType >::type > tempoch::Period< T >::duration ( ) const
inline

◆ end()

template<typename T = ModifiedJulianDate<scale::TT>>
T tempoch::Period< T >::end ( ) const
inline

◆ from_c()

template<typename T = ModifiedJulianDate<scale::TT>>
Period tempoch::Period< T >::from_c ( const tempoch_period_mjd_t & c)
inlinestatic

◆ intersection()

template<typename T = ModifiedJulianDate<scale::TT>>
Period tempoch::Period< T >::intersection ( const Period< T > & other) const
inline

Definition at line 153 of file period.hpp.

◆ length()

template<typename T = ModifiedJulianDate<scale::TT>>
template<typename TargetType = qtty::DayTag>
qtty::Quantity< typename qtty::ExtractTag< TargetType >::type > tempoch::Period< T >::length ( ) const
inline

Returns the length of the period (primary name; duration() is a backward-compat alias).

Definition at line 149 of file period.hpp.

◆ start()

template<typename T = ModifiedJulianDate<scale::TT>>
T tempoch::Period< T >::start ( ) const
inline

◆ to() [1/2]

template<typename T = ModifiedJulianDate<scale::TT>>
template<typename TargetA, typename TargetB>
auto tempoch::Period< T >::to ( ) const
inline

Definition at line 120 of file period.hpp.

◆ to() [2/2]

template<typename T = ModifiedJulianDate<scale::TT>>
template<typename Target>
auto tempoch::Period< T >::to ( ) const
inline

◆ to_with() [1/2]

template<typename T = ModifiedJulianDate<scale::TT>>
template<typename TargetA, typename TargetB>
auto tempoch::Period< T >::to_with ( const TimeContext & ctx) const
inline

Definition at line 134 of file period.hpp.

◆ to_with() [2/2]

template<typename T = ModifiedJulianDate<scale::TT>>
template<typename Target>
auto tempoch::Period< T >::to_with ( const TimeContext & ctx) const
inline

Definition at line 127 of file period.hpp.

◆ union_with()

template<typename T = ModifiedJulianDate<scale::TT>>
std::vector< Period< T > > tempoch::Period< T >::union_with ( const Period< T > & other) const
inline

Definition at line 164 of file period.hpp.


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