QGIS API Documentation  2.99.0-Master (c42dad3)
Public Member Functions | List of all members
QgsExpression::Node Class Referenceabstract

#include <qgsexpression.h>

Inheritance diagram for QgsExpression::Node:
Inheritance graph
[legend]

Public Member Functions

virtual ~Node ()
 
virtual Nodeclone () const =0
 Generate a clone of this node. More...
 
virtual QString dump () const =0
 Abstract virtual dump method. More...
 
virtual QVariant eval (QgsExpression *parent, const QgsExpressionContext *context)=0
 Abstract virtual eval method Errors are reported to the parent. More...
 
virtual bool needsGeometry () const =0
 Abstract virtual method which returns if the geometry is required to evaluate this expression. More...
 
virtual NodeType nodeType () const =0
 Abstract virtual that returns the type of this node. More...
 
virtual bool prepare (QgsExpression *parent, const QgsExpressionContext *context)=0
 Abstract virtual preparation method Errors are reported to the parent. More...
 
virtual QSet< QString > referencedColumns () const =0
 Abstract virtual method which returns a list of columns required to evaluate this node. More...
 
virtual QSet< QString > referencedVariables () const =0
 Return a list of all variables which are used in this expression. More...
 

Detailed Description

Definition at line 842 of file qgsexpression.h.

Constructor & Destructor Documentation

§ ~Node()

virtual QgsExpression::Node::~Node ( )
inlinevirtual

Definition at line 845 of file qgsexpression.h.

Member Function Documentation

§ clone()

virtual Node* QgsExpression::Node::clone ( ) const
pure virtual

Generate a clone of this node.

Make sure that the clone does not contain any information which is generated in prepare and context related. Ownership is transferred to the caller.

Returns
a deep copy of this node.

Implemented in QgsExpression::NodeCondition, QgsExpression::NodeColumnRef, QgsExpression::NodeLiteral, QgsExpression::NodeFunction, QgsExpression::NodeInOperator, QgsExpression::NodeBinaryOperator, and QgsExpression::NodeUnaryOperator.

§ dump()

virtual QString QgsExpression::Node::dump ( ) const
pure virtual

§ eval()

virtual QVariant QgsExpression::Node::eval ( QgsExpression parent,
const QgsExpressionContext context 
)
pure virtual

§ needsGeometry()

virtual bool QgsExpression::Node::needsGeometry ( ) const
pure virtual

Abstract virtual method which returns if the geometry is required to evaluate this expression.

This needs to call needsGeometry() recursively on any child nodes.

Returns
true if a geometry is required to evaluate this expression

Implemented in QgsExpression::NodeCondition, QgsExpression::NodeColumnRef, QgsExpression::NodeLiteral, QgsExpression::NodeFunction, QgsExpression::NodeInOperator, QgsExpression::NodeBinaryOperator, and QgsExpression::NodeUnaryOperator.

§ nodeType()

virtual NodeType QgsExpression::Node::nodeType ( ) const
pure virtual

§ prepare()

virtual bool QgsExpression::Node::prepare ( QgsExpression parent,
const QgsExpressionContext context 
)
pure virtual

§ referencedColumns()

virtual QSet<QString> QgsExpression::Node::referencedColumns ( ) const
pure virtual

Abstract virtual method which returns a list of columns required to evaluate this node.

When reimplementing this, you need to return any column that is required to evaluate this node and in addition recursively collect all the columns required to evaluate child nodes.

Returns
A list of columns required to evaluate this expression

Implemented in QgsExpression::NodeCondition, QgsExpression::NodeColumnRef, QgsExpression::NodeLiteral, QgsExpression::NodeFunction, QgsExpression::NodeInOperator, QgsExpression::NodeBinaryOperator, and QgsExpression::NodeUnaryOperator.

§ referencedVariables()

virtual QSet<QString> QgsExpression::Node::referencedVariables ( ) const
pure virtual

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