QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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 : matthias@opengis.ch
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  , mParserErrors( other.mParserErrors )
48  , mExp( other.mExp )
49  , mCalc( other.mCalc )
50  , mDistanceUnit( other.mDistanceUnit )
51  , mAreaUnit( other.mAreaUnit )
52  {}
53 
54  ~QgsExpressionPrivate()
55  {
56  delete mRootNode;
57  }
58 
59  QAtomicInt ref;
60 
61  QgsExpressionNode *mRootNode = nullptr;
62 
63  QString mParserErrorString;
64  QString mEvalErrorString;
65 
66  QList<QgsExpression::ParserError> mParserErrors;
67 
68  QString mExp;
69 
70  std::shared_ptr<QgsDistanceArea> mCalc;
73 
75  bool mIsPrepared = false;
76 };
78 
79 #endif // QGSEXPRESSIONPRIVATE_H
Unknown areal unit.
Definition: qgsunittypes.h:93
Abstract base class for all nodes that can appear in an expression.
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:54
Unknown distance unit.
Definition: qgsunittypes.h:65
AreaUnit
Units of area.
Definition: qgsunittypes.h:80