QGIS API Documentation 3.39.0-Master (f549811d78c)
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 <QSet>
20#include "qgis_sip.h"
21
22// feature id (currently 64 bit)
23
28typedef qint64 QgsFeatureId SIP_SKIP;
29#define FID_NULL std::numeric_limits<QgsFeatureId>::min()
30#define FID_IS_NULL(fid) ( fid == std::numeric_limits<QgsFeatureId>::min() )
31#define FID_IS_NEW(fid) ( fid < 0 && fid != std::numeric_limits<QgsFeatureId>::min() )
32#define FID_TO_NUMBER(fid) static_cast<qint64>( fid )
33#define FID_TO_STRING(fid) ( fid != std::numeric_limits<QgsFeatureId>::min() ? QString::number( fid ) : QStringLiteral( "NULL" ) )
34#define STRING_TO_FID(str) ( (str).toLongLong() )
35
36#ifndef SIP_RUN
37typedef QSet<QgsFeatureId> QgsFeatureIds;
38#else
39typedef QSet<qint64> QgsFeatureIds;
40#endif
41
42#endif
#define SIP_SKIP
Definition qgis_sip.h:126
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features