5 #include <hilti/ast/builder/type.h> 6 #include <hilti/ast/operators/common.h> 7 #include <hilti/ast/types/integer.h> 8 #include <hilti/ast/types/interval.h> 9 #include <hilti/ast/types/real.h> 13 STANDARD_OPERATOR_2(interval, Equal, type::Bool(), type::Interval(), type::Interval(),
"Compares two interval values.")
14 STANDARD_OPERATOR_2(interval, Unequal, type::Bool(), type::Interval(), type::Interval(),
15 "Compares two interval values.")
16 STANDARD_OPERATOR_2(interval, Sum, type::Interval(), type::Interval(), type::Interval(),
17 "Returns the sum of the intervals.");
18 STANDARD_OPERATOR_2(interval, Difference, type::Interval(), type::Interval(), type::Interval(),
19 "Returns the difference of the intervals.");
20 STANDARD_OPERATOR_2(interval, Greater, type::Bool(), type::Interval(), type::Interval(), "Compares the intervals.");
21 STANDARD_OPERATOR_2(interval, GreaterEqual, type::Bool(), type::Interval(), type::Interval(),
22 "Compares the intervals.");
23 STANDARD_OPERATOR_2(interval, Lower, type::Bool(), type::Interval(), type::Interval(), "Compares the intervals.");
24 STANDARD_OPERATOR_2(interval, LowerEqual, type::Bool(), type::Interval(), type::Interval(), "Compares the intervals.");
25 STANDARD_OPERATOR_2x(interval, MultipleUnsignedInteger, Multiple, type::Interval(), type::Interval(),
26 type::UnsignedInteger(64), "Multiples the interval with the given factor.");
27 STANDARD_OPERATOR_2x(interval, MultipleReal, Multiple, type::Interval(), type::Interval(), type::Real(),
28 "Multiplies the interval with the given factor.");
30 BEGIN_METHOD(interval, Seconds)
31 const auto& signature()
const {
32 static auto _signature =
33 Signature{.self = type::Interval(), .result = type::Real(), .id =
"seconds", .args = {}, .doc = R
"( 34 Returns the interval as a real value representing seconds. 40 BEGIN_METHOD(interval, Nanoseconds)
41 const auto& signature()
const {
42 static auto _signature = Signature{.self = type::Interval(),
43 .result = type::SignedInteger(64),
47 Returns the interval as an integer value representing nanoseconds. Definition: operator-registry.h:15