QGIS API Documentation  2.99.0-Master (e077efd)
Public Member Functions | Protected Attributes | List of all members
QgsExpression::NodeCondition Class Reference

#include <qgsexpression.h>

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

Public Member Functions

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

Protected Attributes

WhenThenList mConditions
 
NodemElseExp
 

Detailed Description

Definition at line 1204 of file qgsexpression.h.

Constructor & Destructor Documentation

§ NodeCondition() [1/2]

QgsExpression::NodeCondition::NodeCondition ( WhenThenList conditions,
Node elseExp = nullptr 
)
inline

Definition at line 1207 of file qgsexpression.h.

§ NodeCondition() [2/2]

QgsExpression::NodeCondition::NodeCondition ( const WhenThenList conditions,
Node elseExp = nullptr 
)
inline

Definition at line 1211 of file qgsexpression.h.

§ ~NodeCondition()

QgsExpression::NodeCondition::~NodeCondition ( )
inline

Definition at line 1215 of file qgsexpression.h.

Member Function Documentation

§ clone()

QgsExpression::Node * QgsExpression::NodeCondition::clone ( ) const
overridevirtual

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.

Implements QgsExpression::Node.

Definition at line 5645 of file qgsexpression.cpp.

§ dump()

QString QgsExpression::NodeCondition::dump ( ) const
overridevirtual

Abstract virtual dump method.

Returns
An expression which represents this node as string

Implements QgsExpression::Node.

Definition at line 5589 of file qgsexpression.cpp.

§ eval()

QVariant QgsExpression::NodeCondition::eval ( QgsExpression parent,
const QgsExpressionContext context 
)
overridevirtual

Abstract virtual eval method Errors are reported to the parent.

Note
added in QGIS 2.12

Implements QgsExpression::Node.

Definition at line 5547 of file qgsexpression.cpp.

§ needsGeometry()

bool QgsExpression::NodeCondition::needsGeometry ( ) const
overridevirtual

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

Implements QgsExpression::Node.

Definition at line 5630 of file qgsexpression.cpp.

§ nodeType()

virtual NodeType QgsExpression::NodeCondition::nodeType ( ) const
inlineoverridevirtual

Abstract virtual that returns the type of this node.

Returns
The type of this node

Implements QgsExpression::Node.

Definition at line 1217 of file qgsexpression.h.

§ prepare()

bool QgsExpression::NodeCondition::prepare ( QgsExpression parent,
const QgsExpressionContext context 
)
overridevirtual

Abstract virtual preparation method Errors are reported to the parent.

Note
added in QGIS 2.12

Implements QgsExpression::Node.

Definition at line 5573 of file qgsexpression.cpp.

§ referencedColumns()

QSet< QString > QgsExpression::NodeCondition::referencedColumns ( ) const
overridevirtual

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

Implements QgsExpression::Node.

Definition at line 5602 of file qgsexpression.cpp.

§ referencedVariables()

QSet< QString > QgsExpression::NodeCondition::referencedVariables ( ) const
overridevirtual

Return a list of all variables which are used in this expression.

Implements QgsExpression::Node.

Definition at line 5616 of file qgsexpression.cpp.

Member Data Documentation

§ mConditions

WhenThenList QgsExpression::NodeCondition::mConditions
protected

Definition at line 1228 of file qgsexpression.h.

§ mElseExp

Node* QgsExpression::NodeCondition::mElseExp
protected

Definition at line 1229 of file qgsexpression.h.


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