QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 explicit QgsFeaturePrivate( QgsFeatureId id )
44 : fid( id )
45 {}
46
47 QgsFeaturePrivate( const QgsFeaturePrivate &other )
48 : QSharedData( other )
49 , fid( other.fid )
50 , attributes( other.attributes )
51 , geometry( other.geometry )
52 , valid( other.valid )
53 , fields( other.fields )
54 , symbol( other.symbol ? other.symbol->clone() : nullptr )
55 {}
56
57 ~QgsFeaturePrivate() {}
58
60 QgsFeatureId fid;
61
63 QgsAttributes attributes;
64
66 QgsGeometry geometry;
67
69 bool valid = false;
70
72 QgsFields fields;
73
74 std::unique_ptr< QgsSymbol > symbol;
75
76 private:
77 QgsFeaturePrivate &operator=( const QgsFeaturePrivate & ) = delete;
78};
79
81
82#endif //QGSFEATURE_PRIVATE_H
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features