Move QgsFeatureId to own header

This commit is contained in:
Matthias Kuhn 2018-09-03 07:54:37 +02:00
parent a6e0e39bcd
commit 74fb0fabc6
6 changed files with 60 additions and 21 deletions

View File

@ -14,8 +14,6 @@
class QgsFeature
{
%Docstring
@ -527,9 +525,6 @@ typedef QMap<qint64, QMap<int, QVariant> > QgsChangedAttributesMap;
typedef QMap<qint64, QgsGeometry> QgsGeometryMap;
typedef QSet<qint64> QgsFeatureIds;
typedef QList<QgsFeature> QgsFeatureList;

View File

@ -0,0 +1,21 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeatureid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
typedef QSet<qint64> QgsFeatureIds;
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeatureid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -44,6 +44,7 @@
%Include auto_generated/qgsexpressioncontextscopegenerator.sip
%Include auto_generated/qgsexpressionfieldbuffer.sip
%Include auto_generated/qgsfeaturefilterprovider.sip
%Include auto_generated/qgsfeatureid.sip
%Include auto_generated/qgsfeatureiterator.sip
%Include auto_generated/qgsfeaturerequest.sip
%Include auto_generated/qgsfeaturesink.sip

View File

@ -851,6 +851,7 @@ SET(QGIS_CORE_HDRS
qgsexpressioncontextscopegenerator.h
qgsexpressionfieldbuffer.h
qgsfeaturefilterprovider.h
qgsfeatureid.h
qgsfeatureiterator.h
qgsfeaturerequest.h
qgsfeaturesink.h

View File

@ -29,6 +29,7 @@ email : sherman at mrcc.com
#include "qgsattributes.h"
#include "qgsfields.h"
#include "qgsfeatureid.h"
class QgsFeature;
class QgsFeaturePrivate;
@ -43,15 +44,6 @@ class QgsRectangle;
* See details in QEP #17
****************************************************************************/
// feature id class (currently 64 bit)
// 64 bit feature ids
typedef qint64 QgsFeatureId SIP_SKIP;
#define FID_IS_NEW(fid) (fid<0)
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
#define FID_TO_STRING(fid) QString::number( fid )
#define STRING_TO_FID(str) (str).toLongLong()
/**
* \ingroup core
@ -540,13 +532,6 @@ typedef QMap<QgsFeatureId, QgsGeometry> QgsGeometryMap;
typedef QMap<qint64, QgsGeometry> QgsGeometryMap;
#endif
#ifndef SIP_RUN
typedef QSet<QgsFeatureId> QgsFeatureIds;
#else
typedef QSet<qint64> QgsFeatureIds;
#endif
typedef QList<QgsFeature> QgsFeatureList;
uint qHash( const QgsFeature &key, uint seed = 0 ) SIP_SKIP;

36
src/core/qgsfeatureid.h Normal file
View File

@ -0,0 +1,36 @@
/***************************************************************************
qgsfeatureid.h
--------------------------------------
Date : 3.9.2018
Copyright : (C) 2018 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSFEATUREID_H
#define QGSFEATUREID_H
#include <QSet>
// feature id (currently 64 bit)
// 64 bit feature ids
typedef qint64 QgsFeatureId SIP_SKIP;
#define FID_IS_NEW(fid) (fid<0)
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
#define FID_TO_STRING(fid) QString::number( fid )
#define STRING_TO_FID(str) (str).toLongLong()
#ifndef SIP_RUN
typedef QSet<QgsFeatureId> QgsFeatureIds;
#else
typedef QSet<qint64> QgsFeatureIds;
#endif
#endif