QGIS API Documentation  2.15.0-Master (13f053b)
Public Member Functions | Protected Attributes | List of all members
QgsExpression::NodeUnaryOperator Class Reference

#include <qgsexpression.h>

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

Public Member Functions

 NodeUnaryOperator (UnaryOperator op, Node *operand)
 
 ~NodeUnaryOperator ()
 
virtual void accept (Visitor &v) const override
 Support the visitor pattern. More...
 
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...
 
UnaryOperator op () const
 
Nodeoperand () 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 Attributes

UnaryOperator mOp
 
NodemOperand
 

Detailed Description

Definition at line 967 of file qgsexpression.h.

Constructor & Destructor Documentation

QgsExpression::NodeUnaryOperator::NodeUnaryOperator ( UnaryOperator  op,
Node operand 
)
inline

Definition at line 970 of file qgsexpression.h.

QgsExpression::NodeUnaryOperator::~NodeUnaryOperator ( )
inline

Definition at line 974 of file qgsexpression.h.

Member Function Documentation

virtual void QgsExpression::NodeUnaryOperator::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 986 of file qgsexpression.h.

QgsExpression::Node * QgsExpression::NodeUnaryOperator::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 3994 of file qgsexpression.cpp.

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

Abstract virtual dump method.

Returns
An expression which represents this node as string

Implements QgsExpression::Node.

Definition at line 3989 of file qgsexpression.cpp.

QVariant QgsExpression::NodeUnaryOperator::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 3957 of file qgsexpression.cpp.

virtual bool QgsExpression::NodeUnaryOperator::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 985 of file qgsexpression.h.

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

Abstract virtual that returns the type of this node.

Returns
The type of this node

Implements QgsExpression::Node.

Definition at line 979 of file qgsexpression.h.

UnaryOperator QgsExpression::NodeUnaryOperator::op ( ) const
inline

Definition at line 976 of file qgsexpression.h.

Node* QgsExpression::NodeUnaryOperator::operand ( ) const
inline

Definition at line 977 of file qgsexpression.h.

bool QgsExpression::NodeUnaryOperator::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 3984 of file qgsexpression.cpp.

virtual QStringList QgsExpression::NodeUnaryOperator::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 984 of file qgsexpression.h.

Member Data Documentation

UnaryOperator QgsExpression::NodeUnaryOperator::mOp
protected

Definition at line 990 of file qgsexpression.h.

Node* QgsExpression::NodeUnaryOperator::mOperand
protected

Definition at line 991 of file qgsexpression.h.


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