QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsfeatureid.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeatureid.h
3 --------------------------------------
4Date : 3.9.2018
5Copyright : (C) 2018 by Matthias Kuhn
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 QGSFEATUREID_H
17#define QGSFEATUREID_H
18
19#include "qgis_sip.h"
20
21#include <QSet>
22#include <QString>
23
24using namespace Qt::StringLiterals;
25
26// feature id (currently 64 bit)
27
32typedef qint64 QgsFeatureId SIP_SKIP;
33#define FID_NULL std::numeric_limits<QgsFeatureId>::min()
34#define FID_IS_NULL(fid) ( fid == std::numeric_limits<QgsFeatureId>::min() )
35#define FID_IS_NEW(fid) ( fid < 0 && fid != std::numeric_limits<QgsFeatureId>::min() )
36#define FID_TO_NUMBER(fid) static_cast<qint64>( fid )
37#define FID_TO_STRING(fid) ( fid != std::numeric_limits<QgsFeatureId>::min() ? QString::number( fid ) : u"NULL"_s )
38#define STRING_TO_FID(str) ( (str).toLongLong() )
39
40#ifndef SIP_RUN
41typedef QSet<QgsFeatureId> QgsFeatureIds;
42#else
43typedef QSet<qint64> QgsFeatureIds;
44#endif
45
46#endif
#define SIP_SKIP
Definition qgis_sip.h:134
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features