QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 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 548 of file qgsexpression.h.

Constructor & Destructor Documentation

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

Definition at line 551 of file qgsexpression.h.

Member Function Documentation

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.

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

Abstract virtual eval method Errors are reported to the parent.

Definition at line 3246 of file qgsexpression.cpp.

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 3253 of file qgsexpression.cpp.

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.

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

Abstract virtual preparation method Errors are reported to the parent.

Definition at line 3265 of file qgsexpression.cpp.

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 3271 of file qgsexpression.cpp.

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: