SeExpr

Classes | Public Types | Public Member Functions | Public Attributes | List of all members
BasicExpression Class Reference

`#include <BasicExpression.h>`

Inheritance diagram for BasicExpression:

## Classes
struct | DummyFuncX
struct | ScalarRef
struct | VectorRef

## Public Types
typedef std::map< std::string, VectorRef * > | VARMAP
typedef std::map< std::string, bool > | FUNCMAP
Public Types inherited from SeExpr2::Expression
enum | EvaluationStrategy { UseInterpreter, UseLLVM }
| Types of evaluation strategies that are available. More...

## Public Member Functions
| BasicExpression (const std::string &expr, const SeExpr2::ExprType &type=SeExpr2::ExprType().FP(3))
virtual | ~BasicExpression ()
SeExpr2::ExprVarRef * | resolveVar (const std::string &name) const
SeExpr2::ExprFunc * | resolveFunc (const std::string &name) const
void | setExpr (const std::string &str)
void | clearVars ()
Public Member Functions inherited from SeExpr2::Expression
| Expression (EvaluationStrategy be=Expression::defaultEvaluationStrategy)
| Expression (const std::string &e, const ExprType &type=ExprType().FP(3), EvaluationStrategy be=Expression::defaultEvaluationStrategy, const Context &context=Context::global())
virtual | ~Expression ()
void | setDesiredReturnType (const ExprType &type)
void | setExpr (const std::string &e)
const std::string & | getExpr () const
| Get the string that this expression is currently set to evaluate. More...
bool | syntaxOK () const
bool | isValid () const
const std::string & | parseError () const
const std::vector< Error > & | getErrors () const
const std::vector< std::pair< int, int > > & | getComments () const
bool | isConstant () const
bool | usesVar (const std::string &name) const
bool | usesFunc (const std::string &name) const
bool | isThreadSafe () const
void | setThreadUnsafe (const std::string &functionName) const
const std::vector< std::string > & | getThreadUnsafeFunctionCalls () const
bool | wantVec () const
bool | isVec () const
const ExprType & | returnType () const
void | evalMultiple (VarBlock *varBlock, int outputVarBlockOffset, size_t rangeStart, size_t rangeEnd) const
| Evaluate multiple blocks. More...
const double * | evalFP (VarBlock *varBlock=nullptr) const
const char * | evalStr (VarBlock *varBlock=nullptr) const
void | reset ()
void | addError (const std::string &error, const int startPos, const int endPos) const
void | addComment (int pos, int length)
const Context & | context () const
void | setContext (const Context &context)
void | debugPrintParseTree () const
void | debugPrintInterpreter () const
void | debugPrintLLVM () const
void | setVarBlockCreator (const VarBlockCreator *varBlockCreator)
const VarBlockCreator * | varBlockCreator () const
void | addVar (const char *n) const
| add local variable (this is for internal use) More...
void | addFunc (const char *n) const
| add function evaluation (this is for internal use) More...

## Public Attributes
BasicExpression::DummyFuncX | dummyFuncX
SeExpr2::ExprFunc | dummyFunc
ScalarRef | u
ScalarRef | v
VectorRef | P
VARMAP | varmap
FUNCMAP | funcmap

## Additional Inherited Members
Static Public Attributes inherited from SeExpr2::Expression
static EvaluationStrategy | defaultEvaluationStrategy = chooseDefaultEvaluationStrategy()
| What evaluation strategy to use by default. More...
static bool | debugging = getenv("SE_EXPR_DEBUG") != 0
| Whether to debug expressions. More...
Protected Member Functions inherited from SeExpr2::Expression
void | prepIfNeeded () const
Protected Attributes inherited from SeExpr2::Expression
ExprType | _desiredReturnType
ExprVarEnvBuilder | _envBuilder
ExprNode * | _parseTree

## Detailed Description

Definition at line 30 of file BasicExpression.h.

## Member Typedef Documentation

## ◆ FUNCMAP

typedef std::map<std::string, bool> BasicExpression::FUNCMAP

Definition at line 81 of file BasicExpression.h.

## ◆ VARMAP

typedef std::map<std::string, VectorRef*> BasicExpression::VARMAP

Definition at line 79 of file BasicExpression.h.

## Constructor & Destructor Documentation

## ◆ BasicExpression()

BasicExpression::BasicExpression | ( | const std::string & | expr,
|  | const SeExpr2::ExprType & | type = `SeExpr2::ExprType().FP(3)`
| ) |  |

Definition at line 24 of file BasicExpression.cpp.

## ◆ ~BasicExpression()

BasicExpression::~BasicExpression | ( |  | ) |
| virtual

Definition at line 27 of file BasicExpression.cpp.

References clearVars().

## Member Function Documentation

## ◆ clearVars()

void BasicExpression::clearVars | ( |  | ) |

Definition at line 35 of file BasicExpression.cpp.

References deleteAndClear(), funcmap, and varmap.

Referenced by setExpr(), and ~BasicExpression().

## ◆ resolveFunc()

SeExpr2::ExprFunc * BasicExpression::resolveFunc | ( | const std::string & | name | ) | const
| virtual

override resolveFunc to add external functions

Reimplemented from SeExpr2::Expression.

Definition at line 64 of file BasicExpression.cpp.

References dummyFunc, funcmap, and SeExpr2::ExprFunc::lookup().

## ◆ resolveVar()

SeExpr2::ExprVarRef * BasicExpression::resolveVar | ( | const std::string & | name | ) | const
| virtual

override resolveVar to add external variables

Reimplemented from SeExpr2::Expression.

Definition at line 45 of file BasicExpression.cpp.

References P, u, v, and varmap.

## ◆ setExpr()

void BasicExpression::setExpr | ( | const std::string & | str | ) |

Definition at line 40 of file BasicExpression.cpp.

References clearVars().

Referenced by ExprDialog::applyExpression(), and ExprDialog::clearExpression().

## Member Data Documentation

## ◆ dummyFunc

SeExpr2::ExprFunc BasicExpression::dummyFunc
| mutable

Definition at line 73 of file BasicExpression.h.

Referenced by resolveFunc().

## ◆ dummyFuncX

BasicExpression::DummyFuncX BasicExpression::dummyFuncX

## ◆ funcmap

FUNCMAP BasicExpression::funcmap
| mutable

Definition at line 82 of file BasicExpression.h.

Referenced by ExprDialog::applyExpression(), clearVars(), and resolveFunc().

## ◆ P

VectorRef BasicExpression::P
| mutable

Definition at line 77 of file BasicExpression.h.

Referenced by resolveVar(), and ExprGrapherView::update().

## ◆ u

ScalarRef BasicExpression::u
| mutable

Definition at line 75 of file BasicExpression.h.

Referenced by resolveVar(), and ExprGrapherView::update().

## ◆ v

ScalarRef BasicExpression::v
| mutable

Definition at line 76 of file BasicExpression.h.

Referenced by resolveVar(), and ExprGrapherView::update().

## ◆ varmap

VARMAP BasicExpression::varmap
| mutable

Definition at line 80 of file BasicExpression.h.

Referenced by ExprDialog::applyExpression(), clearVars(), and resolveVar().

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

- /build/seexpr/src/SeExpr/src/SeExpr2/UI/BasicExpression.h
- /build/seexpr/src/SeExpr/src/SeExpr2/UI/BasicExpression.cpp