|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
An optionally-empty timestamp field. More...
#include <datetime.hpp>
Public Member Functions | |
| constexpr | Timestamp () noexcept=default |
| Constructs the empty state. | |
| constexpr | Timestamp (DateTime instant) noexcept |
Engages with instant. | |
| constexpr | Timestamp (std::optional< DateTime > payload) noexcept |
| Adopts an optional payload as-is. | |
| constexpr bool | hasValue () const noexcept |
| Whether an instant has been entered. | |
| constexpr const DateTime & | operator* () const noexcept |
| Unchecked access to the engaged instant (UB when empty, exactly like std::optional — the unchecked contract is the point). | |
| constexpr auto | operator<=> (const Timestamp &other) const noexcept=default |
| Ordering/equality on the payload; empty sorts before engaged. | |
Static Public Member Functions | |
| static Timestamp | now () noexcept |
| An engaged timestamp holding the current UTC instant. | |
Public Attributes | |
| std::optional< DateTime > | value |
| The payload; std::nullopt means "not entered". | |
An optionally-empty timestamp field.
The blank state ("not entered / not recorded") lives inside, exactly like morph::units::Quantity: action structs never wrap a Timestamp in std::optional, and a non-optional Timestamp member is required by the morph::forms rules.
Definition at line 376 of file datetime.hpp.
|
inlineconstexprnoexcept |
Engages with instant.
| instant | The instant to hold. |
Definition at line 385 of file datetime.hpp.
|
inlineconstexprnoexcept |
Adopts an optional payload as-is.
| payload | Engaged or empty payload. |
Definition at line 389 of file datetime.hpp.
|
inlinestaticnodiscardnoexcept |
An engaged timestamp holding the current UTC instant.
Definition at line 393 of file datetime.hpp.
|
inlinenodiscardconstexprnoexcept |
Whether an instant has been entered.
Definition at line 397 of file datetime.hpp.
|
inlinenodiscardconstexprnoexcept |
Unchecked access to the engaged instant (UB when empty, exactly like std::optional — the unchecked contract is the point).
Definition at line 404 of file datetime.hpp.
|
nodiscardconstexprdefaultnoexcept |
Ordering/equality on the payload; empty sorts before engaged.
| other | Timestamp to compare against. |
| std::optional<DateTime> morph::time::Timestamp::value |
The payload; std::nullopt means "not entered".
Definition at line 378 of file datetime.hpp.