scenario_simulator_v2 C++ API
Classes | Public Types | Public Member Functions | Public Attributes | Friends | List of all members
openscenario_interpreter::reader::Value Struct Reference

Classes

struct  Visitor
 
struct  Visitor< R(Args...)>
 

Public Types

using ExpressionType = Variant< int, unsigned int, unsigned short, double, bool >
 

Public Member Functions

 Value ()
 
 Value (const Value &)=default
 
 Value (Value &&)=default
 
 Value (int v)
 
 Value (unsigned int v)
 
 Value (unsigned short v)
 
 Value (double v)
 
 Value (bool v)
 
 ~Value ()=default
 
auto operator= (const Value &) -> Value &=default
 
auto operator= (Value &&) -> Value &=default
 
auto type_name () const
 
template<typename T >
bool same_as () const
 
template<typename T >
Value cast () const
 
 DEFINE_UNARY (round, [](double v) { return static_cast< int >(std::round(v));}, double, int) DEFINE_UNARY(floor
 
int DEFINE_UNARY (ceil, [](double v) { return static_cast< int >(std::ceil(v));}, double, int) DEFINE_UNARY(sqrt
 
int DEFINE_UNARY (operator-,-, Numeric, Numeric) DEFINE_UNARY(operator!
 
int bool DEFINE_BINARY (operator*, std::multiplies< void >{}, Numeric) DEFINE_BINARY(operator+
 
int bool Numeric DEFINE_BINARY (operator-, std::minus< void >{}, Numeric) DEFINE_BINARY(operator%
 
int bool Numeric Numeric DEFINE_BINARY (operator/, std::divides< double >{}, double) DEFINE_BINARY(operator&&
 
int bool Numeric Numeric bool DEFINE_BINARY (operator||, std::logical_or< bool >{}, bool) DEFINE_BINARY(pow
 
template<typename T >
auto cast () const -> Value
 
template<>
Value cast () const
 

Public Attributes

ExpressionType data
 
double v { return static_cast<int>(std::floor(v))
 
 double
 
int double v { return static_cast<int>(std::sqrt(v))
 
int bool
 

Friends

int bool Numeric Numeric bool double friend std::ostream & operator<< (std::ostream &os, const Value &v)
 
bool operator== (const Value &lhs, const Value &rhs)
 

Member Typedef Documentation

◆ ExpressionType

using openscenario_interpreter::reader::Value::ExpressionType = Variant<int, unsigned int, unsigned short, double, bool>

Constructor & Destructor Documentation

◆ Value() [1/8]

openscenario_interpreter::reader::Value::Value ( )
inline

◆ Value() [2/8]

openscenario_interpreter::reader::Value::Value ( const Value )
default

◆ Value() [3/8]

openscenario_interpreter::reader::Value::Value ( Value &&  )
default

◆ Value() [4/8]

openscenario_interpreter::reader::Value::Value ( int  v)
inlineexplicit

◆ Value() [5/8]

openscenario_interpreter::reader::Value::Value ( unsigned int  v)
inlineexplicit

◆ Value() [6/8]

openscenario_interpreter::reader::Value::Value ( unsigned short  v)
inlineexplicit

◆ Value() [7/8]

openscenario_interpreter::reader::Value::Value ( double  v)
inlineexplicit

◆ Value() [8/8]

openscenario_interpreter::reader::Value::Value ( bool  v)
inlineexplicit

◆ ~Value()

openscenario_interpreter::reader::Value::~Value ( )
default

Member Function Documentation

◆ cast() [1/3]

template<typename T >
Value openscenario_interpreter::reader::Value::cast ( ) const

◆ cast() [2/3]

template<>
Value openscenario_interpreter::reader::Value::cast ( ) const

◆ cast() [3/3]

template<typename T >
auto openscenario_interpreter::reader::Value::cast ( ) const -> Value

◆ DEFINE_BINARY() [1/4]

int bool openscenario_interpreter::reader::Value::DEFINE_BINARY ( operator*  ,
std::multiplies< void >{}  ,
Numeric   
)

◆ DEFINE_BINARY() [2/4]

int bool Numeric openscenario_interpreter::reader::Value::DEFINE_BINARY ( operator-  ,
std::minus< void >{}  ,
Numeric   
)

◆ DEFINE_BINARY() [3/4]

int bool Numeric Numeric openscenario_interpreter::reader::Value::DEFINE_BINARY ( operator/  ,
std::divides< double >{}  ,
double   
) &&

◆ DEFINE_BINARY() [4/4]

int bool Numeric Numeric bool openscenario_interpreter::reader::Value::DEFINE_BINARY ( operator||  ,
std::logical_or< bool >{}  ,
bool   
)

◆ DEFINE_UNARY() [1/3]

int openscenario_interpreter::reader::Value::DEFINE_UNARY ( ceil  ,
[] (double v) { return static_cast< int >(std::ceil(v));}  ,
double  ,
int   
)

◆ DEFINE_UNARY() [2/3]

int openscenario_interpreter::reader::Value::DEFINE_UNARY ( operator-  ,
,
Numeric  ,
Numeric   
)

◆ DEFINE_UNARY() [3/3]

openscenario_interpreter::reader::Value::DEFINE_UNARY ( round  ,
[] (double v) { return static_cast< int >(std::round(v));}  ,
double  ,
int   
)

◆ operator=() [1/2]

auto openscenario_interpreter::reader::Value::operator= ( const Value ) -> Value &=default
default

◆ operator=() [2/2]

auto openscenario_interpreter::reader::Value::operator= ( Value &&  ) -> Value &=default
default

◆ same_as()

template<typename T >
bool openscenario_interpreter::reader::Value::same_as ( ) const
inline

◆ type_name()

auto openscenario_interpreter::reader::Value::type_name ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

int bool Numeric Numeric bool double friend std::ostream& operator<< ( std::ostream &  os,
const Value v 
)
friend

◆ operator==

bool operator== ( const Value lhs,
const Value rhs 
)
friend

Member Data Documentation

◆ bool

int openscenario_interpreter::reader::Value::bool

◆ data

ExpressionType openscenario_interpreter::reader::Value::data

◆ double

openscenario_interpreter::reader::Value::double

◆ v [1/2]

double openscenario_interpreter::reader::Value::v { return static_cast<int>(std::floor(v))

◆ v [2/2]

int double openscenario_interpreter::reader::Value::v { return static_cast<int>(std::sqrt(v))

The documentation for this struct was generated from the following file: