QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsexpression_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsexpression_p.h
3
4 ---------------------
5 begin : 9.12.2015
6 copyright : (C) 2015 by Matthias Kuhn
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSEXPRESSIONPRIVATE_H
18#define QGSEXPRESSIONPRIVATE_H
19
20#include <QString>
21#include <memory>
22
23#include "qgsexpression.h"
24#include "qgsdistancearea.h"
25#include "qgis.h"
26#include "qgsexpressionnode.h"
27
29
35class QgsExpressionPrivate
36{
37 public:
38 QgsExpressionPrivate()
39 : ref( 1 )
40 {}
41
42 QgsExpressionPrivate( const QgsExpressionPrivate &other )
43 : ref( 1 )
44 , mRootNode( other.mRootNode ? other.mRootNode->clone() : nullptr )
45 , mParserErrorString( other.mParserErrorString )
46 , mEvalErrorString( other.mEvalErrorString )
47 , mParserErrors( other.mParserErrors )
48 , mExp( other.mExp )
49 , mDaEllipsoid( other.mDaEllipsoid )
50 , mCalc( other.mCalc )
51 , mDistanceUnit( other.mDistanceUnit )
52 , mAreaUnit( other.mAreaUnit )
53 , mIsPrepared( false )
54 {
55 if ( other.mDaCrs )
56 mDaCrs = std::make_unique<QgsCoordinateReferenceSystem>( *other.mDaCrs.get() );
57 if ( other.mDaTransformContext )
58 mDaTransformContext = std::make_unique<QgsCoordinateTransformContext>( *other.mDaTransformContext.get() );
59 }
60
61 ~QgsExpressionPrivate()
62 {
63 delete mRootNode;
64 }
65
66 QAtomicInt ref;
67
68 QgsExpressionNode *mRootNode = nullptr;
69
70 QString mParserErrorString;
71 QString mEvalErrorString;
72
73 QList<QgsExpression::ParserError> mParserErrors;
74
75 QString mExp;
76
77 QString mDaEllipsoid;
78 std::unique_ptr<QgsCoordinateReferenceSystem> mDaCrs;
79 std::unique_ptr<QgsCoordinateTransformContext> mDaTransformContext;
80
81 std::shared_ptr<QgsDistanceArea> mCalc;
84
86 bool mIsPrepared = false;
87
88 QgsExpressionPrivate &operator= ( const QgsExpressionPrivate & ) = delete;
89};
90
91
93
94#endif // QGSEXPRESSIONPRIVATE_H
DistanceUnit
Units of distance.
Definition: qgis.h:4124
@ Unknown
Unknown distance unit.
AreaUnit
Units of area.
Definition: qgis.h:4162
@ Unknown
Unknown areal unit.
Abstract base class for all nodes that can appear in an expression.