QGIS API Documentation  3.0.2-Girona (307d082)
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 <memory>
22 
23 #include "qgsexpression.h"
24 #include "qgsdistancearea.h"
25 #include "qgsunittypes.h"
26 #include "qgsexpressionnode.h"
27 
29 
35 class 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  , mExp( other.mExp )
48  , mCalc( other.mCalc )
49  , mDistanceUnit( other.mDistanceUnit )
50  , mAreaUnit( other.mAreaUnit )
51  {}
52 
53  ~QgsExpressionPrivate()
54  {
55  delete mRootNode;
56  }
57 
58  QAtomicInt ref;
59 
60  QgsExpressionNode *mRootNode = nullptr;
61 
62  QString mParserErrorString;
63  QString mEvalErrorString;
64 
65  QString mExp;
66 
67  std::shared_ptr<QgsDistanceArea> mCalc;
70 };
72 
73 #endif // QGSEXPRESSIONPRIVATE_H
Square millimeters.
Definition: qgsunittypes.h:82
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:43
Unknown distance unit.
Definition: qgsunittypes.h:54
AreaUnit
Units of area.
Definition: qgsunittypes.h:69