QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsfeature_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfeature_p.h
3  ---------------
4 Date : May-2015
5 Copyright : (C) 2015 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSFEATURE_PRIVATE_H
17 #define QGSFEATURE_PRIVATE_H
18 
20 
21 //
22 // W A R N I N G
23 // -------------
24 //
25 // This file is not part of the QGIS API. It exists purely as an
26 // implementation detail. This header file may change from version to
27 // version without notice, or even be removed.
28 //
29 
30 /***************************************************************************
31  * This class is considered CRITICAL and any change MUST be accompanied with
32  * full unit tests in testqgsfeature.cpp.
33  * See details in QEP #17
34  ****************************************************************************/
35 
36 #include "qgsfields.h"
37 
38 #include "qgsgeometry.h"
39 #include "qgssymbol.h"
40 
41 class QgsFeaturePrivate : public QSharedData
42 {
43  public:
44 
45  explicit QgsFeaturePrivate( QgsFeatureId id )
46  : fid( id )
47  , valid( false )
48  {
49  }
50 
51  QgsFeaturePrivate( const QgsFeaturePrivate &other )
52  : QSharedData( other )
53  , fid( other.fid )
54  , attributes( other.attributes )
55  , geometry( other.geometry )
56  , valid( other.valid )
57  , fields( other.fields )
58  , symbol( other.symbol ? other.symbol->clone() : nullptr )
59  {
60  }
61 
62  ~QgsFeaturePrivate()
63  {
64  }
65 
67  QgsFeatureId fid;
68 
70  QgsAttributes attributes;
71 
73  QgsGeometry geometry;
74 
76  bool valid;
77 
79  QgsFields fields;
80 
81  std::unique_ptr< QgsSymbol > symbol;
82 
83  private:
84  QgsFeaturePrivate &operator=( const QgsFeaturePrivate & ) = delete;
85 
86 };
87 
89 
90 #endif //QGSFEATURE_PRIVATE_H
qgsfields.h
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:44
qgsgeometry.h
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsAttributes
A vector of attributes. Mostly equal to QVector<QVariant>.
Definition: qgsattributes.h:57
qgssymbol.h
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition: qgsfeatureid.h:28