7 #include <hilti/ast/builder/type.h> 8 #include <hilti/ast/operators/common.h> 9 #include <hilti/ast/types/integer.h> 10 #include <hilti/ast/types/interval.h> 11 #include <hilti/ast/types/real.h> 12 #include <hilti/ast/types/time.h> 16 STANDARD_OPERATOR_2(time, Equal, type::Bool(), type::Time(), type::Time(),
"Compares two time values.")
17 STANDARD_OPERATOR_2(time, Unequal, type::Bool(), type::Time(), type::Time(), "Compares two time values.")
18 STANDARD_OPERATOR_2x(time, SumInterval, Sum, type::Time(), type::Time(), type::Interval(),
19 "Adds the interval to the time.");
20 STANDARD_OPERATOR_2x(time, DifferenceTime, Difference, type::Interval(), type::Time(), type::Time(),
21 "Returns the difference of the times.");
22 STANDARD_OPERATOR_2x(time, DifferenceInterval, Difference, type::Time(), type::Time(), type::Interval(),
23 "Subtracts the interval from the time.");
24 STANDARD_OPERATOR_2(time, Greater, type::Bool(), type::Time(), type::Time(), "Compares the times.");
25 STANDARD_OPERATOR_2(time, GreaterEqual, type::Bool(), type::Time(), type::Time(), "Compares the times.");
26 STANDARD_OPERATOR_2(time, Lower, type::Bool(), type::Time(), type::Time(), "Compares the times.");
27 STANDARD_OPERATOR_2(time, LowerEqual, type::Bool(), type::Time(), type::Time(), "Compares the times.");
29 BEGIN_METHOD(time, Seconds)
30 const auto& signature()
const {
31 static auto _signature =
32 Signature{.self = type::Time(), .result = type::Real(), .id =
"seconds", .args = {}, .doc = R
"( 33 Returns the time as a real value representing seconds since the UNIX epoch. 39 BEGIN_METHOD(time, Nanoseconds)
40 const auto& signature()
const {
41 static auto _signature = Signature{.self = type::Time(),
42 .result = type::UnsignedInteger(64),
46 Returns the time as an integer value representing nanoseconds since the UNIX epoch. Definition: operator-registry.h:15