scenario_simulator_v2 C++ API
Classes | Namespaces | Macros | Typedefs | Functions | Variables
object.hpp File Reference
#include <list>
#include <openscenario_interpreter/expression.hpp>
#include <openscenario_interpreter/type_traits/requires.hpp>
#include <typeindex>
#include <utility>
Include dependency graph for object.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openscenario_interpreter::is< T >
 
struct  openscenario_interpreter::is< Object >
 
struct  openscenario_interpreter::is_also< T >
 
struct  openscenario_interpreter::is_also< Object >
 
struct  openscenario_interpreter::Unspecified
 

Namespaces

 openscenario_interpreter
 

Macros

#define CASE(TYPE)
 
#define DEFINE_LAZY_VISITOR(TYPE, ...)
 

Typedefs

using openscenario_interpreter::Object = Pointer< Expression >
 
using openscenario_interpreter::ComplexType = Object
 
using openscenario_interpreter::Group = Object
 
using openscenario_interpreter::Elements = std::list< Object >
 

Functions

template<typename T , typename... Ts>
constexpr auto openscenario_interpreter::make (Ts &&... xs) -> decltype(auto)
 
template<typename T >
constexpr auto openscenario_interpreter::make (T &&x) -> decltype(auto)
 
auto openscenario_interpreter::operator<< (std::ostream &, const Unspecified &) -> std::ostream &
 

Variables

const Object openscenario_interpreter::unspecified {make<Unspecified>()}
 

Macro Definition Documentation

◆ CASE

#define CASE (   TYPE)
Value:
{ \
[](auto & datum) { return datum.template is_also<TYPE>(); }, \
[&](auto & datum, auto &&... args) { \
return function(datum.template as<TYPE>(), std::forward<Args>(args)...); \
} \
}

◆ DEFINE_LAZY_VISITOR

#define DEFINE_LAZY_VISITOR (   TYPE,
  ... 
)
Value:
template <typename Result, typename Function, typename... Args> \
Result apply(Function && function, TYPE & datum, Args &&... args) \
{ \
std::vector<std::pair<std::function<bool(TYPE &)>, std::function<Result(TYPE &, Args &&...)>>> \
dispatcher{{__VA_ARGS__}}; \
for (auto & p : dispatcher) { \
if (p.first(datum)) { \
return p.second(datum, std::forward<Args>(args)...); \
} \
} \
throw UNSUPPORTED_SETTING_DETECTED(TYPE, makeTypename(datum.type().name())); \
} \
static_assert(true, "")
#define UNSUPPORTED_SETTING_DETECTED(ACTION_OR_CONDITION, ELEMENT)
Definition: error.hpp:63
Result
Definition: cpp_scenario_node.hpp:28
auto makeTypename(Ts &&... xs)
Definition: demangle.hpp:30