scenario_simulator_v2 C++ API
Classes | Namespaces | Macros | Functions
evaluate.cpp File Reference
#include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/qi.hpp>
#include <functional>
#include <openscenario_interpreter/reader/evaluate.hpp>
#include <openscenario_interpreter/scope.hpp>
#include <openscenario_interpreter/syntax/parameter_type.hpp>
#include <openscenario_interpreter/utility/overload.hpp>
#include <boost/variant.hpp>
Include dependency graph for evaluate.cpp:

Classes

struct  openscenario_interpreter::reader::Value
 
struct  openscenario_interpreter::reader::Value::Visitor< R(Args...)>
 
struct  openscenario_interpreter::reader::Grammar< Iter >
 

Namespaces

 openscenario_interpreter
 
 openscenario_interpreter::reader
 

Macros

#define DEFINE_UNARY(FNAME, FUNC, ARG, RET)
 
#define DEFINE_BINARY(OP, FUNC, TYPE)
 

Functions

template<>
auto openscenario_interpreter::reader::Value::cast< Value::Numeric > () const -> Value
 
std::string openscenario_interpreter::reader::evaluate (const std::string &, const Scope &)
 

Macro Definition Documentation

◆ DEFINE_BINARY

#define DEFINE_BINARY (   OP,
  FUNC,
  TYPE 
)
Value:
friend Value OP(const Value & lhs, const Value & rhs) \
{ \
return Visitor<TYPE(TYPE, TYPE)>{}.apply( \
[](auto l, auto r) { return FUNC(l, r); }, {lhs, rhs}); \
}

◆ DEFINE_UNARY

#define DEFINE_UNARY (   FNAME,
  FUNC,
  ARG,
  RET 
)
Value:
Value FNAME() const \
{ \
return Visitor<RET(ARG)>{}.apply([](auto v) { return FUNC(v); }, {*this}); \
}