SeExpr

Public Member Functions | Protected Attributes | Private Attributes | List of all members
SeExpr2::ExprFuncX Class Referenceabstract

Extension function spec, used for complicated argument custom functions. More...

`#include <ExprFuncX.h>`

Inheritance diagram for SeExpr2::ExprFuncX:

## Public Member Functions
| ExprFuncX (const bool threadSafe)
virtual ExprType | prep (ExprFuncNode *node, bool scalarWanted, ExprVarEnvBuilder &env) const =0
virtual ExprType | type () const
virtual int | buildInterpreter (const ExprFuncNode *node, Interpreter *interpreter) const =0
| Build an interpreter to evaluate the expression. More...
virtual | ~ExprFuncX ()
bool | isThreadSafe () const
virtual size_t | sizeInBytes () const
| Return memory usage of a funcX in bytes. More...
virtual void | statistics (Statistics &) const
| Give this function a chance to populate its statistics. More...

## Protected Attributes
bool | _isScalar
ExprType | _type

## Private Attributes
bool | _threadSafe

## Detailed Description

Extension function spec, used for complicated argument custom functions.

Provides the ability to handle all argument type checking and processing manually. Derive from this class and then make your own ExprFunc that takes this object. This is necessary if you need string arguments or you have variable numbers of arguments. See ExprBuiltins.h for some examples

Definition at line 35 of file ExprFuncX.h.

## Constructor & Destructor Documentation

## ◆ ExprFuncX()

SeExpr2::ExprFuncX::ExprFuncX | ( | const bool | threadSafe | ) |
| inline

Create an ExprFuncX. If the functions and type checking you implement is thread safe your derived class should call this with true. If not, then false. If you mark a function as thread unsafe, and it is used in an expression then bool Expression::isThreadSafe() will return false and the controlling software should not attempt to run multiple threads of an expression.

Definition at line 43 of file ExprFuncX.h.

## ◆ ~ExprFuncX()

virtual SeExpr2::ExprFuncX::~ExprFuncX | ( |  | ) |
| inline virtual

Definition at line 54 of file ExprFuncX.h.

## Member Function Documentation

## ◆ buildInterpreter()

virtual int SeExpr2::ExprFuncX::buildInterpreter | ( | const ExprFuncNode * | node,
|  | Interpreter * | interpreter
| ) |  | const
| pure virtual

Build an interpreter to evaluate the expression.

evaluate the expression. the given node is where in the parse tree the evaluation is for

Implemented in SeExpr2::ExprFuncStandard, SeExpr2::ExprFuncLocal, and SeExpr2::ExprFuncSimple.

Referenced by SeExpr2::ExprFuncNode::buildInterpreter().

## ◆ isThreadSafe()

bool SeExpr2::ExprFuncX::isThreadSafe | ( |  | ) | const
| inline

Definition at line 56 of file ExprFuncX.h.

References _threadSafe.

## ◆ prep()

virtual ExprType SeExpr2::ExprFuncX::prep | ( | ExprFuncNode * | node,
|  | bool | scalarWanted,
|  | ExprVarEnvBuilder & | env
| ) |  | const
| pure virtual

prep the expression by doing all type checking argument checking, etc.

Implemented in BasicExpression::DummyFuncX, SeExpr2::PrintFuncX, SeExpr2::GetVar, SeExpr2::CCurveFuncX, SeExpr2::TriplanarFuncX, SeExpr2::MapFuncX, SeExpr2::RandFuncX, SeExpr2::ExprFuncSimple, SeExpr2::CurveFuncX, SeExpr2::CachedVoronoiFunc, SeExpr2::ExprFuncStandard, and SeExpr2::ExprFuncLocal.

Referenced by SeExpr2::ExprFuncNode::prep().

## ◆ sizeInBytes()

virtual size_t SeExpr2::ExprFuncX::sizeInBytes | ( |  | ) | const
| inline virtual

Return memory usage of a funcX in bytes.

Definition at line 59 of file ExprFuncX.h.

## ◆ statistics()

virtual void SeExpr2::ExprFuncX::statistics | ( | Statistics & |  | ) | const
| inline virtual

Give this function a chance to populate its statistics.

Definition at line 62 of file ExprFuncX.h.

## ◆ type()

virtual ExprType SeExpr2::ExprFuncX::type | ( |  | ) | const
| inline virtual

Definition at line 47 of file ExprFuncX.h.

References _type.

## Member Data Documentation

## ◆ _isScalar

bool SeExpr2::ExprFuncX::_isScalar
| protected

Definition at line 65 of file ExprFuncX.h.

## ◆ _threadSafe

bool SeExpr2::ExprFuncX::_threadSafe
| private

Definition at line 69 of file ExprFuncX.h.

Referenced by isThreadSafe().

## ◆ _type

ExprType SeExpr2::ExprFuncX::_type
| protected

Definition at line 66 of file ExprFuncX.h.

Referenced by type().

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

- /build/seexpr/src/SeExpr/src/SeExpr2/ExprFuncX.h