KiCad PCB EDA Suite
Loading...
Searching...
No Matches
calc_parser::EVAL_VISITOR Class Reference

#include <text_eval_parser.h>

Public Types

using VariableCallback = std::function<Result<Value>(const std::string& aVariableName)>
 

Public Member Functions

 EVAL_VISITOR (VariableCallback aVariableCallback, ERROR_COLLECTOR &aErrorCollector)
 Construct evaluator with variable callback function.
 
auto operator() (const NODE &aNode) const -> Result< Value >
 

Private Member Functions

auto evaluateFunction (const FUNC_DATA &aFunc) const -> Result< Value >
 

Private Attributes

VariableCallback m_variableCallback
 
ERROR_COLLECTORm_errors
 
std::random_device m_rd
 
std::mt19937 m_gen
 

Detailed Description

Definition at line 400 of file text_eval_parser.h.

Member Typedef Documentation

◆ VariableCallback

using calc_parser::EVAL_VISITOR::VariableCallback = std::function<Result<Value>(const std::string& aVariableName)>

Definition at line 404 of file text_eval_parser.h.

Constructor & Destructor Documentation

◆ EVAL_VISITOR()

calc_parser::EVAL_VISITOR::EVAL_VISITOR ( VariableCallback aVariableCallback,
ERROR_COLLECTOR & aErrorCollector )
explicit

Construct evaluator with variable callback function.

Parameters
aVariableCallbackFunction to call when resolving variables
aErrorCollectorError collector for storing errors

Definition at line 322 of file text_eval_parser.cpp.

References m_errors, m_gen, m_rd, m_variableCallback, and move.

Member Function Documentation

◆ evaluateFunction()

◆ operator()()

Member Data Documentation

◆ m_errors

ERROR_COLLECTOR& calc_parser::EVAL_VISITOR::m_errors
private

Definition at line 408 of file text_eval_parser.h.

Referenced by EVAL_VISITOR().

◆ m_gen

std::mt19937 calc_parser::EVAL_VISITOR::m_gen
mutableprivate

Definition at line 410 of file text_eval_parser.h.

Referenced by EVAL_VISITOR(), and evaluateFunction().

◆ m_rd

std::random_device calc_parser::EVAL_VISITOR::m_rd
mutableprivate

Definition at line 409 of file text_eval_parser.h.

Referenced by EVAL_VISITOR().

◆ m_variableCallback

VariableCallback calc_parser::EVAL_VISITOR::m_variableCallback
private

Definition at line 407 of file text_eval_parser.h.

Referenced by EVAL_VISITOR(), and operator()().


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