FuncSketch
Loading...
Searching...
No Matches
func_sketch::expressions::Expression Class Reference

Class of expressions. More...

#include <func_sketch/expressions/expression.h>

Collaboration diagram for func_sketch::expressions::Expression:

Public Types

using VariantType
 Type of the variant of expressions.

Public Member Functions

 Expression (ConstantExpression expression)
 Constructor.
 Expression (ParameterExpression expression)
 Constructor.
 Expression (UnaryExpression expression)
 Constructor.
 Expression (BinaryExpression expression)
 Constructor.
 Expression (FunctionCallExpression expression)
 Constructor.
template<typename T>
const T & as () const
 Get as a type.
const VariantTypeas_variant () const
 Get the expression as variant.

Private Attributes

VariantType expression_
 Expression.

Detailed Description

Class of expressions.

Note
This class must have a forward declaration to implement tree structures of expressions. So this class is not a simple alias of std::variant.

Definition at line 41 of file expression.h.

Member Typedef Documentation

◆ VariantType

Constructor & Destructor Documentation

◆ Expression() [1/5]

func_sketch::expressions::Expression::Expression ( ConstantExpression expression)
inlineexplicit

Constructor.

Parameters
[in]expressionExpression.

Definition at line 52 of file expression.h.

◆ Expression() [2/5]

func_sketch::expressions::Expression::Expression ( ParameterExpression expression)
inlineexplicit

Constructor.

Parameters
[in]expressionExpression.

Definition at line 60 of file expression.h.

◆ Expression() [3/5]

func_sketch::expressions::Expression::Expression ( UnaryExpression expression)
inlineexplicit

Constructor.

Parameters
[in]expressionExpression.

Definition at line 68 of file expression.h.

◆ Expression() [4/5]

func_sketch::expressions::Expression::Expression ( BinaryExpression expression)
inlineexplicit

Constructor.

Parameters
[in]expressionExpression.

Definition at line 75 of file expression.h.

◆ Expression() [5/5]

func_sketch::expressions::Expression::Expression ( FunctionCallExpression expression)
inlineexplicit

Constructor.

Parameters
[in]expressionExpression.

Definition at line 83 of file expression.h.

Member Function Documentation

◆ as()

template<typename T>
const T & func_sketch::expressions::Expression::as ( ) const
inlinenodiscard

Get as a type.

Template Parameters
TType.
Returns
Expression as the type.

Definition at line 93 of file expression.h.

◆ as_variant()

const VariantType & func_sketch::expressions::Expression::as_variant ( ) const
inlinenodiscard

Get the expression as variant.

Returns
Expression as variant.

Definition at line 102 of file expression.h.

Member Data Documentation

◆ expression_

VariantType func_sketch::expressions::Expression::expression_
private

Expression.

Definition at line 106 of file expression.h.


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