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

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

#include <ExprFuncX.h>

Inheritance diagram for KSeExpr::ExprFuncX:
KSeExpr::ExprFuncLocal KSeExpr::ExprFuncSimple KSeExpr::ExprFuncStandard BasicExpression::DummyFuncX KSeExpr::CCurveFuncX KSeExpr::CachedVoronoiFunc KSeExpr::CurveFuncX KSeExpr::GetVar KSeExpr::MapFuncX KSeExpr::PrintFuncX KSeExpr::RandFuncX KSeExpr::SPrintFuncX KSeExpr::TriplanarFuncX

Public Member Functions

 ExprFuncX (const bool threadSafe)
 
 ExprFuncX (const ExprFuncX &)=default
 
 ExprFuncX (ExprFuncX &&)=default
 
ExprFuncXoperator= (const ExprFuncX &)=default
 
ExprFuncXoperator= (ExprFuncX &&)=default
 
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 ()=default
 
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 23 of file ExprFuncX.h.

Constructor & Destructor Documentation

◆ ExprFuncX() [1/3]

KSeExpr::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 31 of file ExprFuncX.h.

◆ ExprFuncX() [2/3]

KSeExpr::ExprFuncX::ExprFuncX ( const ExprFuncX )
default

◆ ExprFuncX() [3/3]

KSeExpr::ExprFuncX::ExprFuncX ( ExprFuncX &&  )
default

◆ ~ExprFuncX()

virtual KSeExpr::ExprFuncX::~ExprFuncX ( )
virtualdefault

Member Function Documentation

◆ buildInterpreter()

virtual int KSeExpr::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 KSeExpr::ExprFuncLocal, KSeExpr::ExprFuncSimple, and KSeExpr::ExprFuncStandard.

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

◆ isThreadSafe()

bool KSeExpr::ExprFuncX::isThreadSafe ( ) const
inline

Definition at line 48 of file ExprFuncX.h.

References _threadSafe.

◆ operator=() [1/2]

ExprFuncX& KSeExpr::ExprFuncX::operator= ( const ExprFuncX )
default

◆ operator=() [2/2]

ExprFuncX& KSeExpr::ExprFuncX::operator= ( ExprFuncX &&  )
default

◆ prep()

virtual ExprType KSeExpr::ExprFuncX::prep ( ExprFuncNode node,
bool  scalarWanted,
ExprVarEnvBuilder env 
) const
pure virtual

◆ sizeInBytes()

virtual size_t KSeExpr::ExprFuncX::sizeInBytes ( ) const
inlinevirtual

Return memory usage of a funcX in bytes.

Definition at line 51 of file ExprFuncX.h.

◆ statistics()

virtual void KSeExpr::ExprFuncX::statistics ( Statistics ) const
inlinevirtual

Give this function a chance to populate its statistics.

Definition at line 54 of file ExprFuncX.h.

◆ type()

virtual ExprType KSeExpr::ExprFuncX::type ( ) const
inlinevirtual

Definition at line 39 of file ExprFuncX.h.

References _type.

Member Data Documentation

◆ _isScalar

bool KSeExpr::ExprFuncX::_isScalar {}
protected

Definition at line 57 of file ExprFuncX.h.

◆ _threadSafe

bool KSeExpr::ExprFuncX::_threadSafe
private

Definition at line 61 of file ExprFuncX.h.

Referenced by isThreadSafe().

◆ _type

ExprType KSeExpr::ExprFuncX::_type
protected

Definition at line 58 of file ExprFuncX.h.

Referenced by type().


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