Skip to content

Commit

Permalink
Move QgsFeatureId to own header
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 3, 2018
1 parent a6e0e39 commit 74fb0fa
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 21 deletions.
5 changes: 0 additions & 5 deletions python/core/auto_generated/qgsfeature.sip.in
Expand Up @@ -14,8 +14,6 @@





class QgsFeature
{
%Docstring
Expand Down Expand Up @@ -527,9 +525,6 @@ typedef QMap<qint64, QMap<int, QVariant> > QgsChangedAttributesMap;

typedef QMap<qint64, QgsGeometry> QgsGeometryMap;


typedef QSet<qint64> QgsFeatureIds;

typedef QList<QgsFeature> QgsFeatureList;


Expand Down
21 changes: 21 additions & 0 deletions python/core/auto_generated/qgsfeatureid.sip.in
@@ -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 *
************************************************************************/
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Expand Up @@ -851,6 +851,7 @@ SET(QGIS_CORE_HDRS
qgsexpressioncontextscopegenerator.h
qgsexpressionfieldbuffer.h
qgsfeaturefilterprovider.h
qgsfeatureid.h
qgsfeatureiterator.h
qgsfeaturerequest.h
qgsfeaturesink.h
Expand Down
17 changes: 1 addition & 16 deletions src/core/qgsfeature.h
Expand Up @@ -29,6 +29,7 @@ email : sherman at mrcc.com

#include "qgsattributes.h"
#include "qgsfields.h"
#include "qgsfeatureid.h"

class QgsFeature;
class QgsFeaturePrivate;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
36 changes: 36 additions & 0 deletions src/core/qgsfeatureid.h
@@ -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

0 comments on commit 74fb0fa

Please sign in to comment.