QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 <memory>
21
22#include "qgis.h"
23#include "qgsdistancearea.h"
24#include "qgsexpression.h"
25#include "qgsexpressionnode.h"
26
27#include <QString>
28
30
36class QgsExpressionPrivate
37{
38 public:
39 QgsExpressionPrivate()
40 : ref( 1 )
41 {}
42
43 QgsExpressionPrivate( const QgsExpressionPrivate &other )
44 : ref( 1 )
45 , mRootNode( other.mRootNode ? other.mRootNode->clone() : nullptr )
46 , mParserErrorString( other.mParserErrorString )
47 , mEvalErrorString( other.mEvalErrorString )
48 , mParserErrors( other.mParserErrors )
49 , mExp( other.mExp )
50 , mDaEllipsoid( other.mDaEllipsoid )
51 , mCalc( other.mCalc )
52 , mDistanceUnit( other.mDistanceUnit )
53 , mAreaUnit( other.mAreaUnit )
54 , mIsPrepared( false )
55 {
56 if ( other.mDaCrs )
57 mDaCrs = std::make_unique<QgsCoordinateReferenceSystem>( *other.mDaCrs.get() );
58 if ( other.mDaTransformContext )
59 mDaTransformContext = std::make_unique<QgsCoordinateTransformContext>( *other.mDaTransformContext.get() );
60 }
61
62 ~QgsExpressionPrivate()
63 {
64
65 }
66
67 QAtomicInt ref;
68
69 std::unique_ptr<QgsExpressionNode> mRootNode;
70
71 QString mParserErrorString;
72 QString mEvalErrorString;
73
74 QList<QgsExpression::ParserError> mParserErrors;
75
76 QString mExp;
77
78 QString mDaEllipsoid;
79 std::unique_ptr<QgsCoordinateReferenceSystem> mDaCrs;
80 std::unique_ptr<QgsCoordinateTransformContext> mDaTransformContext;
81
82 std::shared_ptr<QgsDistanceArea> mCalc;
85
87 bool mIsPrepared = false;
88
89 QgsExpressionPrivate &operator= ( const QgsExpressionPrivate & ) = delete;
90};
91
92
94
95#endif // QGSEXPRESSIONPRIVATE_H
DistanceUnit
Units of distance.
Definition qgis.h:5013
@ Unknown
Unknown distance unit.
Definition qgis.h:5063
AreaUnit
Units of area.
Definition qgis.h:5090
@ Unknown
Unknown areal unit.
Definition qgis.h:5103