32 QVariant res = evalNode( parent, context );
55 return prepareNode( parent, context );
66 : parserFirstLine( other.parserFirstLine )
67 , parserFirstColumn( other.parserFirstColumn )
68 , parserLastLine( other.parserLastLine )
69 , parserLastColumn( other.parserLastColumn )
70 , mHasCachedValue( other.mHasCachedValue )
71 , mCachedStaticValue( other.mCachedStaticValue )
72 , mCompiledSimplifiedNode( other.mCompiledSimplifiedNode ? other.mCompiledSimplifiedNode->clone() : nullptr )
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract base class for all nodes that can appear in an expression.
void setCachedStaticValue(const QVariant &value) const
Sets the cached static value for the node.
QVariant eval(QgsExpression *parent, const QgsExpressionContext *context)
Evaluate this node with the given context and parent.
virtual bool isStatic(QgsExpression *parent, const QgsExpressionContext *context) const =0
Returns true if this node can be evaluated for a static value.
bool prepare(QgsExpression *parent, const QgsExpressionContext *context)
Prepare this node for evaluation.
bool mHasCachedValue
true if the node has a static, precalculated value.
QVariant mCachedStaticValue
Contains the static, precalculated value for the node if mHasCachedValue is true.
QgsExpressionNode()=default
Constructor.
std::unique_ptr< QgsExpressionNode > mCompiledSimplifiedNode
Contains a compiled node which represents a simplified version of this node as a result of compilatio...
int parserFirstLine
First line in the parser this node was found.
QgsExpressionNode & operator=(const QgsExpressionNode &other)
Assignment operator.
int parserLastLine
Last line in the parser this node was found.
void cloneTo(QgsExpressionNode *target) const
Copies the members of this node to the node provided in target.
int parserLastColumn
Last column in the parser this node was found.
int parserFirstColumn
First column in the parser this node was found.
Class for parsing and evaluation of expressions (formerly called "search strings").
bool hasEvalError() const
Returns true if an error occurred when evaluating last input.