15 #ifndef OPENSCENARIO_INTERPRETER__OBJECT_HPP_
16 #define OPENSCENARIO_INTERPRETER__OBJECT_HPP_
58 template <
typename T,
typename... Ts>
59 constexpr
auto make(Ts &&...
xs) -> decltype(
auto)
61 return Object::bind<T>(std::forward<decltype(
xs)>(
xs)...);
65 constexpr
auto make(T && x) -> decltype(
auto)
67 return Object::bind<
typename std::decay<decltype(x)>::type>(std::forward<decltype(x)>(x));
74 auto evaluate() const noexcept -> decltype(auto)
80 auto operator<<(std::ostream &,
const Unspecified &) -> std::ostream &;
85 [](auto & datum) { return datum.template is_also<TYPE>(); }, \
86 [&](auto & datum, auto &&... args) { \
87 return function(datum.template as<TYPE>(), std::forward<Args>(args)...); \
91 #define DEFINE_LAZY_VISITOR(TYPE, ...) \
92 template <typename Result, typename Function, typename... Args> \
93 Result apply(Function && function, TYPE & datum, Args &&... args) \
95 std::vector<std::pair<std::function<bool(TYPE &)>, std::function<Result(TYPE &, Args &&...)>>> \
96 dispatcher{{__VA_ARGS__}}; \
97 for (auto & p : dispatcher) { \
98 if (p.first(datum)) { \
99 return p.second(datum, std::forward<Args>(args)...); \
102 throw UNSUPPORTED_SETTING_DETECTED(TYPE, makeTypename(datum.type().name())); \
104 static_assert(true, "")
static Pointer bind(Ts &&... xs)
Definition: pointer.hpp:72
std::list< Object > Elements
Definition: object.hpp:56
Pointer< Expression > Object
Definition: object.hpp:26
const Object unspecified
Definition: object.cpp:19
auto operator<<(std::ostream &, const Unspecified &) -> std::ostream &
Definition: object.cpp:21
constexpr auto make(Ts &&... xs) -> decltype(auto)
Definition: object.hpp:59
Definition: junit5.hpp:25
Definition: object.hpp:73
auto evaluate() const noexcept -> decltype(auto)
Definition: object.hpp:74
auto operator()(const Object &) const noexcept
Definition: object.hpp:37
auto operator()(const Object &) const noexcept
Definition: object.hpp:49
Definition: object.hpp:42
auto operator()(const Object &object) const
Definition: object.hpp:43
Definition: object.hpp:30
auto operator()(const Object &object) const
Definition: object.hpp:31