17#ifndef QGSEXPRESSIONNODE_H
18#define QGSEXPRESSIONNODE_H
22#include <QCoreApplication>
39 switch ( sipCpp->nodeType() )
42 sipType = sipType_QgsExpressionNodeUnaryOperator;
45 sipType = sipType_QgsExpressionNodeBinaryOperator;
48 sipType = sipType_QgsExpressionNodeInOperator;
51 sipType = sipType_QgsExpressionNodeFunction;
54 sipType = sipType_QgsExpressionNodeLiteral;
57 sipType = sipType_QgsExpressionNodeColumnRef;
60 sipType = sipType_QgsExpressionNodeCondition;
63 sipType = sipType_QgsExpressionNodeBetweenOperator;
137 int count()
const {
return mList.count(); }
148 QList<QgsExpressionNode *>
list() {
return mList; }
161 QStringList
names()
const {
return mNameList; }
169 virtual QString dump() const;
173 QStringList mNameList;
175 bool mHasNamedNodes = false;
180 static QString cleanNamedNodeName( const QString &name );
199 virtual QString dump() const = 0;
236 virtual QSet<QString> referencedColumns() const = 0;
244 virtual QSet<QString> referencedVariables() const = 0;
252 virtual QSet<QString> referencedFunctions() const = 0;
270 virtual
bool needsGeometry() const = 0;
297 int parserFirstLine = 0;
304 int parserFirstColumn = 0;
311 int parserLastLine = 0;
318 int parserLastColumn = 0;
326 bool hasCachedStaticValue()
const {
return mHasCachedValue; }
380 mutable bool mHasCachedValue =
false;
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A list of expression nodes.
bool hasNamedNodes() const
Returns true if list contains any named nodes.
QStringList names() const
Returns a list of names for nodes.
void append(QgsExpressionNode *node)
Takes ownership of the provided node.
QList< QgsExpressionNode * > list()
Gets a list of all the nodes.
QgsExpressionNode * at(int i)
Gets the node at position i in the list.
int count() const
Returns the number of nodes in the list.
Abstract base class for all nodes that can appear in an expression.
const QgsExpressionNode * effectiveNode() const
Returns a reference to the simplest node which represents this node, after any compilation optimizati...
QVariant cachedStaticValue() const
Returns the node's static cached value.
QVariant mCachedStaticValue
Contains the static, precalculated value for the node if mHasCachedValue is true.
QgsExpressionNode()=default
Constructor.
std::unique_ptr< QgsExpressionNode > mCompiledSimplifiedNode
Contains a compiled node which represents a simplified version of this node as a result of compilatio...
NodeType
Known node types.
@ ntBetweenOperator
Between operator.
@ ntIndexOperator
Index operator.
Class for parsing and evaluation of expressions (formerly called "search strings").
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
NamedNode(const QString &name, QgsExpressionNode *node)
Constructor for NamedNode.