QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 void accept (Visitor &v) const =0
 Support the visitor pattern. More...
 
virtual Nodeclone () const =0
 Generate a clone of this node. More...
 
virtual QString dump () const =0
 Abstract virtual dump method. More...
 
virtual Q_DECL_DEPRECATED QVariant eval (QgsExpression *parent, const QgsFeature *f)
 Abstract virtual eval method Errors are reported to the parent. More...
 
virtual QVariant eval (QgsExpression *parent, const QgsExpressionContext *context)
 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 Q_DECL_DEPRECATED bool prepare (QgsExpression *parent, const QgsFields &fields)
 Abstract virtual preparation method Errors are reported to the parent. More...
 
virtual bool prepare (QgsExpression *parent, const QgsExpressionContext *context)
 Abstract virtual preparation method Errors are reported to the parent. More...
 
virtual QStringList referencedColumns () const =0
 Abstract virtual method which returns a list of columns required to evaluate this node. More...
 

Detailed Description

Definition at line 922 of file qgsexpression.h.

Constructor & Destructor Documentation

◆ ~Node()

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

Definition at line 925 of file qgsexpression.h.

Member Function Documentation

◆ accept()

virtual void QgsExpression::Node::accept ( Visitor v) const
pure virtual

Support the visitor pattern.

For any implementation this should look like

C++:

v.visit( *this );

Python:

v.visit( self)
Parameters
vA visitor that visits this node.

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

◆ 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() [1/2]

QVariant QgsExpression::Node::eval ( QgsExpression parent,
const QgsFeature f 
)
virtual

Abstract virtual eval method Errors are reported to the parent.

Deprecated:
use QgsExpressionContext variant instead

Definition at line 5283 of file qgsexpression.cpp.

◆ eval() [2/2]

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

Abstract virtual eval method Errors are reported to the parent.

Note
added in QGIS 2.12

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

Definition at line 5290 of file qgsexpression.cpp.

◆ 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() [1/2]

bool QgsExpression::Node::prepare ( QgsExpression parent,
const QgsFields fields 
)
virtual

Abstract virtual preparation method Errors are reported to the parent.

Deprecated:
use QgsExpressionContext variant instead

Definition at line 5302 of file qgsexpression.cpp.

◆ prepare() [2/2]

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

Abstract virtual preparation method Errors are reported to the parent.

Note
added in QGIS 2.12

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

Definition at line 5308 of file qgsexpression.cpp.

◆ referencedColumns()

virtual QStringList 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.


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