#include <time.hpp>
◆ operator DayFraction()
mtcore::calendars::NanoSeconds::operator DayFraction |
( |
| ) |
const |
|
explicitnodiscardconstexpr |
Definition at line 218 of file calendars/mtcore_calendars/time.hpp.
218 {
222 ensure(res.try_validate().is_success());
223 return res;
224 }
constexpr i64 NANOS_PER_DAY
Number of nanoseconds per day.
#define ensure(check,...)
Ensures that a check holds true, aborts the program if not true Will print error if the condition is ...
double f64
Alias for 64-bit floats.
long double f80
Alias for 80-bit floats.
constexpr Result< void, TimeValidationError > try_validate() const
Tries to validate.
◆ operator Segments()
mtcore::calendars::NanoSeconds::operator Segments |
( |
| ) |
const |
|
explicitnodiscardconstexpr |
Definition at line 226 of file calendars/mtcore_calendars/time.hpp.
226 {
228
230
234
238
242
244 const auto res = Segments{
245 .hour =
static_cast<u8>(
val),
246 .minute = minutes,
247 .second = seconds,
249 };
250
251 ensure(res.try_validate().is_success());
252 return res;
253 }
constexpr i32 NANOS_PER_SECOND
Number of nanoseconds per second.
ValIter< T > val(const T &r)
Generic value iterator that uses the operator[] and incrementing indexes to iterate over a collection...
constexpr Res mod(L left, R right) noexcept
Calculates the mathematical mod of two numbers.
uint64_t u64
Alias for 64-bit unsigned ints.
uint8_t u8
Alias for 8-bit unsigned ints.
◆ operator!=()
bool mtcore::calendars::NanoSeconds::operator!= |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscard |
◆ operator<()
bool mtcore::calendars::NanoSeconds::operator< |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscard |
◆ operator<=()
bool mtcore::calendars::NanoSeconds::operator<= |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscard |
Definition at line 170 of file calendars/mtcore_calendars/time.hpp.
170 {
171 const auto cmp = (*this <=> o);
172 return cmp == std::strong_ordering::equal || cmp == std::strong_ordering::less;
173 }
◆ operator<=>()
auto mtcore::calendars::NanoSeconds::operator<=> |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscardconstexpr |
◆ operator==()
bool mtcore::calendars::NanoSeconds::operator== |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscard |
◆ operator>()
bool mtcore::calendars::NanoSeconds::operator> |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscard |
◆ operator>=()
bool mtcore::calendars::NanoSeconds::operator>= |
( |
const NanoSeconds & | o | ) |
const |
|
inlinenodiscard |
Definition at line 174 of file calendars/mtcore_calendars/time.hpp.
174 {
175 const auto cmp = (*this <=> o);
176 return cmp == std::strong_ordering::equal || cmp == std::strong_ordering::greater;
177 }
◆ try_validate()
Tries to validate.
Will return validation error describing what's wrong if invalid.
Definition at line 154 of file calendars/mtcore_calendars/time.hpp.
154 {
157 }
159 }
Success< void > success()
Creates a successful void Result object.
Error< Underlying > error(Underlying err)
Creates an error.
static constexpr auto max
◆ max
◆ nano
u64 mtcore::calendars::NanoSeconds::nano |
The documentation for this struct was generated from the following file: