KSeExpr  4.0.4.0
Classes | Public Member Functions | Private Attributes | List of all members
KSeExpr::VarBlockCreator Class Reference

A class that lets you register for the variables used by one or more expressions. More...

#include <VarBlock.h>

Classes

class  Ref
 Internally implemented var ref used by SeExpr. More...
 

Public Member Functions

int registerVariable (const std::string &name, const ExprType &type)
 Register a variable and return a handle. More...
 
VarBlock create (bool makeThreadSafe=false) const
 
ExprVarRefresolveVar (const std::string &name) const
 Resolve the variable using anything in the data block (call from resolveVar in Expr subclass) More...
 

Private Attributes

int _nextOffset {}
 
std::map< std::string, Ref_vars
 

Detailed Description

A class that lets you register for the variables used by one or more expressions.

Definition at line 89 of file VarBlock.h.

Member Function Documentation

◆ create()

VarBlock KSeExpr::VarBlockCreator::create ( bool  makeThreadSafe = false) const
inline

Get an evaluation handle (one needed per thread)

Parameters
makeThreadSafeIf true, right before evaluating the expression, all data used by the interpreter will be copied to the var block, to make the evaluation thread safe (assuming there's one var block instead per thread) If false or not specified, the old behavior occurs (var block will only hold variables sources and optionally output data, and the interpreter will work on its internal data)

Definition at line 145 of file VarBlock.h.

References _nextOffset.

◆ registerVariable()

int KSeExpr::VarBlockCreator::registerVariable ( const std::string &  name,
const ExprType type 
)
inline

Register a variable and return a handle.

Definition at line 124 of file VarBlock.h.

References _nextOffset, _vars, and KSeExpr::ExprType::dim().

◆ resolveVar()

ExprVarRef* KSeExpr::VarBlockCreator::resolveVar ( const std::string &  name) const
inline

Resolve the variable using anything in the data block (call from resolveVar in Expr subclass)

Definition at line 151 of file VarBlock.h.

References _vars.

Member Data Documentation

◆ _nextOffset

int KSeExpr::VarBlockCreator::_nextOffset {}
private

Definition at line 160 of file VarBlock.h.

Referenced by create(), and registerVariable().

◆ _vars

std::map<std::string, Ref> KSeExpr::VarBlockCreator::_vars
private

Definition at line 161 of file VarBlock.h.

Referenced by registerVariable(), and resolveVar().


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