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(); }
144 void reserve(
int size ) { mList.reserve( size ); }
155 QList<QgsExpressionNode *>
list() {
return mList; }
168 QStringList
names()
const {
return mNameList; }
176 virtual QString dump() const;
180 QStringList mNameList;
182 bool mHasNamedNodes = false;
187 static QString cleanNamedNodeName( const QString &name );
206 virtual QString dump() const = 0;
243 virtual QSet<QString> referencedColumns() const = 0;
251 virtual QSet<QString> referencedVariables() const = 0;
259 virtual QSet<QString> referencedFunctions() const = 0;
277 virtual
bool needsGeometry() const = 0;
304 int parserFirstLine = 0;
311 int parserFirstColumn = 0;
318 int parserLastLine = 0;
325 int parserLastColumn = 0;
333 bool hasCachedStaticValue()
const {
return mHasCachedValue; }
350 void setCachedStaticValue(
const QVariant &value )
const SIP_SKIP;
396 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.