QGIS API Documentation  2.14.0-Essen
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  , mRowNumber( 0 )
51  , mScale( other.mScale )
52  , mExp( other.mExp )
53  , mCalc( other.mCalc )
54  , mDistanceUnit( other.mDistanceUnit )
55  , mAreaUnit( other.mAreaUnit )
56  {}
57 
58  ~QgsExpressionPrivate()
59  {
60  delete mRootNode;
61  }
62 
63  QAtomicInt ref;
64 
65  QgsExpression::Node* mRootNode;
66 
67  QString mParserErrorString;
68  QString mEvalErrorString;
69 
70  int mRowNumber;
71  double mScale;
72  QString mExp;
73 
75  QGis::UnitType mDistanceUnit;
76  QgsUnitTypes::AreaUnit mAreaUnit;
77 };
79 
80 #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:36
UnitType
Map units that qgis supports.
Definition: qgis.h:155
AreaUnit
Units of area.
Definition: qgsunittypes.h:49