MT Core (C++)
Core library for replacing C++ standard in project usage
|
#include <core.hpp>
Public Types | |
using | CalendarSystem = Calendar |
Public Member Functions | |
constexpr Segments | time_segments () const |
constexpr | operator CalDate< Calendar > () const noexcept |
constexpr bool | is_valid () const |
Checks that a date is valid. | |
constexpr CalDateTime | nearest_valid () const |
Moves the date to the nearest valid date. | |
template<typename Other> | |
constexpr | operator CalDateTime< Other > () const noexcept |
template<IsTimeCalendarSystem Other> | |
constexpr std::partial_ordering | operator<=> (const CalDateTime< Other > &o) const |
template<IsDayCalendarSystem Other> | |
constexpr std::partial_ordering | operator<=> (const CalDateTime< Other > &o) const |
template<typename Other> | |
constexpr auto | operator== (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator!= (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator<= (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator>= (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator< (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator> (const CalDateTime< Other > &o) const -> bool |
constexpr DayOfWeek | day_of_week () const |
Gets the day of week for a date. | |
constexpr CalDateTime | add_days (const i32 days) const |
Adds n days to a date. | |
constexpr CalDateTime | sub_days (const i32 days) const |
Subtracts n days from a date. | |
template<typename Other> | |
constexpr i32 | day_difference (const CalDateTime< Other > &other) const |
Difference between two dates in days. | |
constexpr CalDateTime | nth_week_day (const i32 n, const DayOfWeek k) const |
Gets the nth day of week. | |
constexpr CalDateTime | day_of_week_before (const DayOfWeek k) const |
Gets the day of week before current date. | |
constexpr CalDateTime | day_of_week_after (const DayOfWeek k) const |
Gets the day of week after the current date. | |
constexpr CalDateTime | day_of_week_nearest (const DayOfWeek k) const |
Gets the day of week nearest to the current date. | |
constexpr CalDateTime | day_of_week_on_or_before (const DayOfWeek k) const |
Gets the day of week on or before the current date. | |
constexpr CalDateTime | day_of_week_on_or_after (const DayOfWeek k) const |
Gets the day of week on or after the current date. | |
constexpr CalDateTime | first_week_day (const DayOfWeek k) const |
Gets the first week day in a month (assuming current date is the start of the month) | |
constexpr CalDateTime | last_week_day (const DayOfWeek k) const |
Gets the last week day in a month (assuming current date is the end of the month) | |
template<typename Other> | |
auto | positions_in_range (Allocator &alloc, const CalDateTime< Other > &end, i32 pthMoment, i32 cDayCycle, i32 delta) const -> Result< ArrayList< CalDateTime >, AllocationError > |
Return the cyclic positions in the range of the current date to the end date (exclusive) Used to collect all occurrences of events (e.g. | |
i32 | day_of_m_cycle (i32 m, i32 offset) const |
Gets which day the current date occurs in an m-length ("month") cycle. | |
auto | kth_day_of_m_cycle_on_or_before (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs on or before the current date. | |
auto | kth_day_of_m_cycle_before (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs before the current date. | |
auto | kth_day_of_m_cycle_on_or_after (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs on or after the current date. | |
auto | kth_day_of_m_cycle_after (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs after the current date. | |
auto | kth_day_of_m_cycle_nearest (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs nearest the current date. | |
constexpr bool | is_valid () const |
Checks that a date is valid. | |
constexpr CalDateTime | nearest_valid () const |
Moves the date to the nearest valid date. | |
constexpr Segments | time_segments () const |
constexpr | operator CalDate< Fixed > () const noexcept |
template<typename Other> | |
constexpr | operator CalDateTime< Other > () const noexcept |
template<IsDayCalendarSystem Other> | |
constexpr std::partial_ordering | operator<=> (const CalDateTime< Other > &o) const |
template<IsTimeCalendarSystem Other> | |
constexpr std::partial_ordering | operator<=> (const CalDateTime< Other > &o) const |
template<typename Other> | |
constexpr auto | operator== (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator!= (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator<= (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator>= (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator< (const CalDateTime< Other > &o) const -> bool |
template<typename Other> | |
constexpr auto | operator> (const CalDateTime< Other > &o) const -> bool |
constexpr DayOfWeek | day_of_week () const |
Gets the day of week for a date. | |
constexpr CalDateTime | add_days (const i32 days) const |
Adds n days to a date. | |
constexpr CalDateTime | sub_days (const i32 days) const |
Subtracts n days from a date. | |
template<typename Other> | |
constexpr i32 | day_difference (const CalDateTime< Other > &other) const |
Difference between two dates in days. | |
constexpr CalDateTime | nth_week_day (const i32 n, const DayOfWeek k) const |
Gets the nth day of week. | |
constexpr CalDateTime | day_of_week_before (const DayOfWeek k) const |
Gets the day of week before current date. | |
constexpr CalDateTime | day_of_week_after (const DayOfWeek k) const |
Gets the day of week after the current date. | |
constexpr CalDateTime | day_of_week_nearest (const DayOfWeek k) const |
Gets the day of week nearest to the current date. | |
constexpr CalDateTime | day_of_week_on_or_before (const DayOfWeek k) const |
Gets the day of week on or before the current date. | |
constexpr CalDateTime | day_of_week_on_or_after (const DayOfWeek k) const |
Gets the day of week on or after the current date. | |
constexpr CalDateTime | first_week_day (const DayOfWeek k) const |
Gets the first week day in a month (assuming current date is the start of the month) | |
constexpr CalDateTime | last_week_day (const DayOfWeek k) const |
Gets the last week day in a month (assuming current date is the end of the month) | |
template<typename Other> | |
auto | positions_in_range (Allocator &alloc, const CalDateTime< Other > &end, i32 pthMoment, i32 cDayCycle, i32 delta) const -> Result< ArrayList< CalDateTime >, AllocationError > |
Return the cyclic positions in the range of the current date to the end date (exclusive) Used to collect all occurrences of events (e.g. | |
i32 | day_of_m_cycle (i32 m, i32 offset) const |
Gets which day the current date occurs in an m-length ("month") cycle. | |
auto | kth_day_of_m_cycle_on_or_before (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs on or before the current date. | |
auto | kth_day_of_m_cycle_before (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs before the current date. | |
auto | kth_day_of_m_cycle_on_or_after (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs on or after the current date. | |
auto | kth_day_of_m_cycle_after (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs after the current date. | |
auto | kth_day_of_m_cycle_nearest (i32 k, i32 m, i32 offset) const noexcept -> CalDateTime |
Finds the kth day of the m-cycle that occurs nearest the current date. | |
Public Attributes | |
Calendar | cal |
Segments | time = {} |
Calendar | dateTime |
Definition at line 372 of file calendars/mtcore_calendars/core.hpp.
using mtcore::calendars::CalDateTime< Calendar >::CalendarSystem = Calendar |
Definition at line 373 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Adds n days to a date.
Definition at line 478 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Adds n days to a date.
Definition at line 728 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Difference between two dates in days.
Definition at line 489 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Difference between two dates in days.
Definition at line 739 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscard |
Gets which day the current date occurs in an m-length ("month") cycle.
m | Length of cycle |
offset | Offset for start of cycle |
Definition at line 579 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscard |
Gets which day the current date occurs in an m-length ("month") cycle.
m | Length of cycle |
offset | Offset for start of cycle |
Definition at line 839 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week for a date.
Definition at line 475 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week for a date.
Definition at line 723 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week after the current date.
Definition at line 505 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week after the current date.
Definition at line 757 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week before current date.
Definition at line 500 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week before current date.
Definition at line 751 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week nearest to the current date.
Definition at line 510 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week nearest to the current date.
Definition at line 763 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week on or after the current date.
Definition at line 520 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week on or after the current date.
Definition at line 775 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week on or before the current date.
Definition at line 515 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the day of week on or before the current date.
Definition at line 769 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the first week day in a month (assuming current date is the start of the month)
Definition at line 525 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the first week day in a month (assuming current date is the start of the month)
Definition at line 781 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Checks that a date is valid.
Definition at line 382 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Checks that a date is valid.
Definition at line 642 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs after the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 621 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs after the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 888 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs before the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 599 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs before the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 863 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs nearest the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 632 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs nearest the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 900 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs on or after the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 610 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs on or after the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 875 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs on or before the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 588 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardnoexcept |
Finds the kth day of the m-cycle that occurs on or before the current date.
k | The kth day of the m-cycle |
m | The number of days in the m-cycle |
offset | The offset of the m-cycle |
Definition at line 850 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the last week day in a month (assuming current date is the end of the month)
Definition at line 530 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the last week day in a month (assuming current date is the end of the month)
Definition at line 787 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Moves the date to the nearest valid date.
Definition at line 385 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Moves the date to the nearest valid date.
Definition at line 645 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the nth day of week.
Definition at line 495 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Gets the nth day of week.
Definition at line 745 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 379 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 655 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 399 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 660 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 449 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 697 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
Definition at line 410 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 427 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 676 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 682 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 444 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 692 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscard |
Return the cyclic positions in the range of the current date to the end date (exclusive) Used to collect all occurrences of events (e.g.
holidays) in an interval of time (e.g. a Gregorian year)
Assumes $0 \le pthMoment \lt cDayCycle$
alloc | Allocator to use |
end | End of the cyclic range |
pthMoment | Starting pth moment search. First result on or after a given moment of the pth moment (basically the cycle start) |
cDayCycle | The number of days in the occurrence day cycle (basically the cycle length) |
delta | Congruent modulo of cDayCycle to the position of RdDate{0} in the repeating cycle (basically the cycle modulo offset) |
Definition at line 550 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscard |
Return the cyclic positions in the range of the current date to the end date (exclusive) Used to collect all occurrences of events (e.g.
holidays) in an interval of time (e.g. a Gregorian year)
Assumes $0 \le pthMoment \lt cDayCycle$
alloc | Allocator to use |
end | End of the cyclic range |
pthMoment | Starting pth moment search. First result on or after a given moment of the pth moment (basically the cycle start) |
cDayCycle | The number of days in the occurrence day cycle (basically the cycle length) |
delta | Congruent modulo of cDayCycle to the position of RdDate{0} in the repeating cycle (basically the cycle modulo offset) |
Definition at line 808 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Subtracts n days from a date.
Definition at line 483 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Subtracts n days from a date.
Definition at line 733 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 377 of file calendars/mtcore_calendars/core.hpp.
|
inlinenodiscardconstexpr |
Definition at line 649 of file calendars/mtcore_calendars/core.hpp.
Calendar mtcore::calendars::CalDateTime< Calendar >::cal |
Definition at line 374 of file calendars/mtcore_calendars/core.hpp.
Calendar mtcore::calendars::CalDateTime< Calendar >::dateTime |
Definition at line 639 of file calendars/mtcore_calendars/core.hpp.
Segments mtcore::calendars::CalDateTime< Calendar >::time = {} |
Definition at line 375 of file calendars/mtcore_calendars/core.hpp.