QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsexpressionprivate.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsexpressionprivate.h
3 
4  ---------------------
5  begin : 9.12.2015
6  copyright : (C) 2015 by Matthias Kuhn
7  email : [email protected]
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 <QSharedPointer>
22 
23 #include "qgsexpression.h"
24 #include "qgsdistancearea.h"
25 #include "qgsunittypes.h"
26 
28 
33 class QgsExpressionPrivate
34 {
35  public:
36  QgsExpressionPrivate()
37  : ref( 1 )
38  , mRootNode( nullptr )
39  , mRowNumber( 0 )
40  , mScale( 0 )
41  , mCalc( nullptr )
42  , mDistanceUnit( QGis::UnknownUnit )
43  , mAreaUnit( QgsUnitTypes::UnknownAreaUnit )
44  {}
45 
46  QgsExpressionPrivate( const QgsExpressionPrivate& other )
47  : ref( 1 )
48  , mRootNode( other.mRootNode ? other.mRootNode->clone() : nullptr )
49  , mParserErrorString( other.mParserErrorString )
50  , mEvalErrorString( other.mEvalErrorString )
51  , mRowNumber( 0 )
52  , mScale( other.mScale )
53  , mExp( other.mExp )
54  , mCalc( other.mCalc )
55  , mDistanceUnit( other.mDistanceUnit )
56  , mAreaUnit( other.mAreaUnit )
57  {}
58 
59  ~QgsExpressionPrivate()
60  {
61  delete mRootNode;
62  }
63 
64  QAtomicInt ref;
65 
66  QgsExpression::Node* mRootNode;
67 
68  QString mParserErrorString;
69  QString mEvalErrorString;
70 
71  int mRowNumber;
72  double mScale;
73  QString mExp;
74 
76  QGis::UnitType mDistanceUnit;
77  QgsUnitTypes::AreaUnit mAreaUnit;
78 };
80 
81 #endif // QGSEXPRESSIONPRIVATE_H
Helper functions for various unit types.
Definition: qgsunittypes.h:35
The QGis class provides global constants for use throughout the application.
Definition: qgis.h:40
UnitType
Map units that qgis supports.
Definition: qgis.h:159
AreaUnit
Units of area.
Definition: qgsunittypes.h:49