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;
133 int count()
const {
return mList.count(); }
144 QList<QgsExpressionNode *>
list() {
return mList; }
157 QStringList
names()
const {
return mNameList; }
165 virtual QString dump() const;
169 QStringList mNameList;
171 bool mHasNamedNodes = false;
176 static QString cleanNamedNodeName( const QString &name );
195 virtual QString dump() const = 0;
232 virtual QSet<QString> referencedColumns() const = 0;
240 virtual QSet<QString> referencedVariables() const = 0;
248 virtual QSet<QString> referencedFunctions() const = 0;
266 virtual
bool needsGeometry() const = 0;
293 int parserFirstLine = 0;
300 int parserFirstColumn = 0;
307 int parserLastLine = 0;
314 int parserLastColumn = 0;
322 bool hasCachedStaticValue()
const {
return mHasCachedValue; }
376 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.
QgsExpressionNode * at(int i)
Gets the node at position i in the list.
QList< QgsExpressionNode * > list()
Gets a list of all the nodes.
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.
@ ntIndexOperator
Index operator.
Class for parsing and evaluation of expressions (formerly called "search strings").
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
NamedNode(const QString &name, QgsExpressionNode *node)
Constructor for NamedNode.