QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
qgsfeature_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeature_p.h
3 ---------------
4Date : May-2015
5Copyright : (C) 2015 by Nyall Dawson
6email : 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#include "qgsgeometry.h"
38#include "qgssymbol.h"
39
40class QgsFeaturePrivate : public QSharedData
41{
42 public:
43
44 explicit QgsFeaturePrivate( QgsFeatureId id )
45 : fid( id )
46 {
47 }
48
49 QgsFeaturePrivate( const QgsFeaturePrivate &other )
50 : QSharedData( other )
51 , fid( other.fid )
52 , attributes( other.attributes )
53 , geometry( other.geometry )
54 , valid( other.valid )
55 , fields( other.fields )
56 , symbol( other.symbol ? other.symbol->clone() : nullptr )
57 {
58 }
59
60 ~QgsFeaturePrivate()
61 {
62 }
63
65 QgsFeatureId fid;
66
68 QgsAttributes attributes;
69
71 QgsGeometry geometry;
72
74 bool valid = false;
75
77 QgsFields fields;
78
79 std::unique_ptr< QgsSymbol > symbol;
80
81 private:
82 QgsFeaturePrivate &operator=( const QgsFeaturePrivate & ) = delete;
83
84};
85
87
88#endif //QGSFEATURE_PRIVATE_H
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features