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;
135 int count()
const {
return mList.count(); }
142 void reserve(
int size ) { mList.reserve( size ); }
152 QList<QgsExpressionNode *>
list() {
return mList; }
163 QStringList
names()
const {
return mNameList; }
171 virtual QString dump() const;
175 QStringList mNameList;
177 bool mHasNamedNodes = false;
182 static QString cleanNamedNodeName( const QString &name );
201 virtual QString dump() const = 0;
237 virtual QSet<QString> referencedColumns() const = 0;
245 virtual QSet<QString> referencedVariables() const = 0;
253 virtual QSet<QString> referencedFunctions() const = 0;
271 virtual
bool needsGeometry() const = 0;
296 int parserFirstLine = 0;
303 int parserFirstColumn = 0;
310 int parserLastLine = 0;
317 int parserLastColumn = 0;
325 bool hasCachedStaticValue()
const {
return mHasCachedValue; }
342 void setCachedStaticValue(
const QVariant &value )
const SIP_SKIP;
387 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.
void reserve(int size)
Reserves size for the node list.
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.