QGIS API Documentation  2.11.0-Master
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsExpression::NodeBinaryOperator Class Reference

#include <qgsexpression.h>

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

Public Member Functions

 NodeBinaryOperator (BinaryOperator op, Node *opLeft, Node *opRight)
 
 ~NodeBinaryOperator ()
 
virtual void accept (Visitor &v) const override
 Support the visitor pattern. 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...
 
bool leftAssociative () const
 
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...
 
BinaryOperator op () const
 
NodeopLeft () const
 
NodeopRight () const
 
int precedence () const
 
virtual bool prepare (QgsExpression *parent, const QgsExpressionContext *context) override
 Abstract virtual preparation method Errors are reported to the parent. More...
 
virtual QStringList referencedColumns () const override
 Abstract virtual method which returns a list of columns required to evaluate this node. More...
 
- Public Member Functions inherited from QgsExpression::Node
virtual ~Node ()
 
virtual Q_DECL_DEPRECATED QVariant eval (QgsExpression *parent, const QgsFeature *f)
 Abstract virtual eval method Errors are reported to the parent. More...
 
virtual Q_DECL_DEPRECATED bool prepare (QgsExpression *parent, const QgsFields &fields)
 Abstract virtual preparation method Errors are reported to the parent. More...
 

Protected Member Functions

bool compare (double diff)
 
QDateTime computeDateTimeFromInterval (QDateTime d, QgsExpression::Interval *i)
 
double computeDouble (double x, double y)
 
int computeInt (int x, int y)
 

Protected Attributes

BinaryOperator mOp
 
NodemOpLeft
 
NodemOpRight
 

Detailed Description

Definition at line 705 of file qgsexpression.h.

Constructor & Destructor Documentation

QgsExpression::NodeBinaryOperator::NodeBinaryOperator ( BinaryOperator  op,
Node opLeft,
Node opRight 
)
inline

Definition at line 708 of file qgsexpression.h.

QgsExpression::NodeBinaryOperator::~NodeBinaryOperator ( )
inline

Definition at line 709 of file qgsexpression.h.

Member Function Documentation

virtual void QgsExpression::NodeBinaryOperator::accept ( Visitor v) const
inlineoverridevirtual

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.

Implements QgsExpression::Node.

Definition at line 722 of file qgsexpression.h.

bool QgsExpression::NodeBinaryOperator::compare ( double  diff)
protected

Definition at line 2655 of file qgsexpression.cpp.

QDateTime QgsExpression::NodeBinaryOperator::computeDateTimeFromInterval ( QDateTime  d,
QgsExpression::Interval i 
)
protected

Definition at line 2682 of file qgsexpression.cpp.

double QgsExpression::NodeBinaryOperator::computeDouble ( double  x,
double  y 
)
protected

Definition at line 2692 of file qgsexpression.cpp.

int QgsExpression::NodeBinaryOperator::computeInt ( int  x,
int  y 
)
protected

Definition at line 2669 of file qgsexpression.cpp.

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

Abstract virtual dump method.

Returns
An expression which represents this node as string

Implements QgsExpression::Node.

Definition at line 2794 of file qgsexpression.cpp.

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

Abstract virtual eval method Errors are reported to the parent.

Note
added in QGIS 2.12

Reimplemented from QgsExpression::Node.

Definition at line 2463 of file qgsexpression.cpp.

bool QgsExpression::NodeBinaryOperator::leftAssociative ( ) const

Definition at line 2758 of file qgsexpression.cpp.

virtual bool QgsExpression::NodeBinaryOperator::needsGeometry ( ) const
inlineoverridevirtual

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 721 of file qgsexpression.h.

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

Abstract virtual that returns the type of this node.

Returns
The type of this node

Implements QgsExpression::Node.

Definition at line 715 of file qgsexpression.h.

BinaryOperator QgsExpression::NodeBinaryOperator::op ( ) const
inline

Definition at line 711 of file qgsexpression.h.

Node* QgsExpression::NodeBinaryOperator::opLeft ( ) const
inline

Definition at line 712 of file qgsexpression.h.

Node* QgsExpression::NodeBinaryOperator::opRight ( ) const
inline

Definition at line 713 of file qgsexpression.h.

int QgsExpression::NodeBinaryOperator::precedence ( ) const

Definition at line 2712 of file qgsexpression.cpp.

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

Abstract virtual preparation method Errors are reported to the parent.

Note
added in QGIS 2.12

Reimplemented from QgsExpression::Node.

Definition at line 2705 of file qgsexpression.cpp.

virtual QStringList QgsExpression::NodeBinaryOperator::referencedColumns ( ) const
inlineoverridevirtual

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 720 of file qgsexpression.h.

Member Data Documentation

BinaryOperator QgsExpression::NodeBinaryOperator::mOp
protected

Definition at line 733 of file qgsexpression.h.

Node* QgsExpression::NodeBinaryOperator::mOpLeft
protected

Definition at line 734 of file qgsexpression.h.

Node* QgsExpression::NodeBinaryOperator::mOpRight
protected

Definition at line 735 of file qgsexpression.h.


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