MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::calendars::AnnoDominiYear Class Reference

#include <core.hpp>

Public Member Functions

 AnnoDominiYear ()=default
 
 AnnoDominiYear (const YearBase year)
 
 operator YearBase () const
 
 operator AstronomicalYear () const
 
AnnoDominiYear operator+ (YearBase years) const
 
AnnoDominiYear operator- (YearBase years) const
 
YearBase difference (AnnoDominiYear o) const
 
auto operator<=> (const AnnoDominiYear &o) const -> std::strong_ordering
 
auto operator== (const AnnoDominiYear &o) const -> bool
 
auto operator!= (const AnnoDominiYear &o) const -> bool
 
auto operator< (const AnnoDominiYear &o) const -> bool
 
auto operator> (const AnnoDominiYear &o) const -> bool
 
auto operator>= (const AnnoDominiYear &o) const -> bool
 
auto operator<= (const AnnoDominiYear &o) const -> bool
 

Static Public Member Functions

static bool is_valid (const YearBase year)
 

Detailed Description

Definition at line 59 of file calendars/mtcore_calendars/core.hpp.

Constructor & Destructor Documentation

◆ AnnoDominiYear() [1/2]

mtcore::calendars::AnnoDominiYear::AnnoDominiYear ( )
default
Here is the caller graph for this function:

◆ AnnoDominiYear() [2/2]

mtcore::calendars::AnnoDominiYear::AnnoDominiYear ( const YearBase year)
inline

Definition at line 64 of file calendars/mtcore_calendars/core.hpp.

64: year(year) { ensure(is_valid(year)); }
#define ensure(check,...)
Ensures that a check holds true, aborts the program if not true Will print error if the condition is ...
Here is the call graph for this function:

Member Function Documentation

◆ difference()

YearBase mtcore::calendars::AnnoDominiYear::difference ( AnnoDominiYear o) const
inlinenodiscard

Definition at line 75 of file calendars/mtcore_calendars/core.hpp.

75 {
76 return static_cast<AstronomicalYear>(*this).difference(static_cast<AstronomicalYear>(o));
77 }
Here is the call graph for this function:

◆ is_valid()

static bool mtcore::calendars::AnnoDominiYear::is_valid ( const YearBase year)
inlinestatic

Definition at line 86 of file calendars/mtcore_calendars/core.hpp.

86{ return year != 0; }
Here is the caller graph for this function:

◆ operator AstronomicalYear()

mtcore::calendars::AnnoDominiYear::operator AstronomicalYear ( ) const
inlineexplicit

Definition at line 69 of file calendars/mtcore_calendars/core.hpp.

69{ return {year > 0 ? year : year + 1}; }

◆ operator YearBase()

mtcore::calendars::AnnoDominiYear::operator YearBase ( ) const
inlineexplicit

Definition at line 65 of file calendars/mtcore_calendars/core.hpp.

65 {
66 ensure(year != 0);
67 return year;
68 }

◆ operator!=()

auto mtcore::calendars::AnnoDominiYear::operator!= ( const AnnoDominiYear & o) const -> bool
inlinenodiscard

Definition at line 80 of file calendars/mtcore_calendars/core.hpp.

80{ return year != o.year; }
Here is the call graph for this function:

◆ operator+()

AnnoDominiYear mtcore::calendars::AnnoDominiYear::operator+ ( YearBase years) const
inlinenodiscard

Definition at line 71 of file calendars/mtcore_calendars/core.hpp.

71 {
72 return static_cast<AnnoDominiYear>(static_cast<AstronomicalYear>(*this) + years);
73 }
Here is the call graph for this function:

◆ operator-()

AnnoDominiYear mtcore::calendars::AnnoDominiYear::operator- ( YearBase years) const
inlinenodiscard

Definition at line 74 of file calendars/mtcore_calendars/core.hpp.

74{ return *this + -years; }
Here is the call graph for this function:

◆ operator<()

auto mtcore::calendars::AnnoDominiYear::operator< ( const AnnoDominiYear & o) const -> bool
inlinenodiscard

Definition at line 81 of file calendars/mtcore_calendars/core.hpp.

81{ return year < o.year; }
Here is the call graph for this function:

◆ operator<=()

auto mtcore::calendars::AnnoDominiYear::operator<= ( const AnnoDominiYear & o) const -> bool
inlinenodiscard

Definition at line 84 of file calendars/mtcore_calendars/core.hpp.

84{ return year <= o.year; }
Here is the call graph for this function:

◆ operator<=>()

auto mtcore::calendars::AnnoDominiYear::operator<=> ( const AnnoDominiYear & o) const -> std::strong_ordering
inlinenodiscard

Definition at line 78 of file calendars/mtcore_calendars/core.hpp.

78{ return year <=> o.year; }
Here is the call graph for this function:

◆ operator==()

auto mtcore::calendars::AnnoDominiYear::operator== ( const AnnoDominiYear & o) const -> bool
inlinenodiscard

Definition at line 79 of file calendars/mtcore_calendars/core.hpp.

79{ return year == o.year; }
Here is the call graph for this function:

◆ operator>()

auto mtcore::calendars::AnnoDominiYear::operator> ( const AnnoDominiYear & o) const -> bool
inlinenodiscard

Definition at line 82 of file calendars/mtcore_calendars/core.hpp.

82{ return year > o.year; }
Here is the call graph for this function:

◆ operator>=()

auto mtcore::calendars::AnnoDominiYear::operator>= ( const AnnoDominiYear & o) const -> bool
inlinenodiscard

Definition at line 83 of file calendars/mtcore_calendars/core.hpp.

83{ return year >= o.year; }
Here is the call graph for this function:

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