tempoch-cpp 0.5.3
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)
 
start () const
 
end () const
 
template<typename TargetType = qtty::DayTag>
qtty::Quantity< typename qtty::ExtractTag< TargetType >::typeduration () const
 
template<typename TargetType = qtty::DayTag>
qtty::Quantity< typename qtty::ExtractTag< TargetType >::typelength () 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_tc_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 53 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 63 of file period.hpp.

References tempoch::check_status(), tempoch::Period< T >::end(), tempoch::scale_tag_v, and tempoch::Period< T >::start().

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 126 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

◆ contains()

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

Definition at line 93 of file period.hpp.

References tempoch::scale_tag_v.

◆ 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

Definition at line 75 of file period.hpp.

References tempoch::scale_tag_v.

◆ end()

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

Definition at line 72 of file period.hpp.

Referenced by tempoch::Period< T >::Period().

◆ from_c()

template<typename T = ModifiedJulianDate<scale::TT>>
static 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

◆ 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 82 of file period.hpp.

References tempoch::scale_tag_v.

◆ start()

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

Definition at line 71 of file period.hpp.

Referenced by tempoch::Period< T >::Period().

◆ union_with()

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

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