Skip to content

Commit a14ad32

Browse files
committedMay 23, 2017
sipify QgsVectorLayerFeatureIterator
1 parent 8d2f42a commit a14ad32

File tree

9 files changed

+231
-135
lines changed

9 files changed

+231
-135
lines changed
 

‎.ci/travis/code_layout/before_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# #
1414
###########################################################################
1515

16-
pip install autopep8
16+
pip install autopep8

‎.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ matrix:
4141

4242

4343
- os: linux
44-
language: python # This lets us use newer python versions from virtualenv
44+
language: python
4545
env:
4646
- TRAVIS_CONFIG=code_layout
4747
dist: trusty
4848
sudo: false
4949
cache:
5050
apt: true
51-
#compiler: clang
52-
#python: "3.3"
5351
addons:
5452
apt:
5553
sources:
@@ -59,10 +57,11 @@ matrix:
5957
- xvfb
6058
- flip
6159
# used for spell checks
62-
- perl # lookahead regex in spell check script
60+
- perl # sipify, lookahead regex in spell check script
6361
- silversearcher-ag
6462
- expect-dev # unbuffer
6563
- coreutils
64+
- libyaml-tiny-perl
6665
# OSX based build with QT4 and Python 2
6766
- os: osx
6867
osx_image: xcode8.3 # MacOS 10.12: Sierra

‎python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ core/conversions.sip
22
core/qgsexception.sip
33
core/qgis.sip
44
core/qgsrange.sip
5-
core/qgsvectorlayerfeatureiterator.sip
65
core/composer/qgsaddremoveitemcommand.sip
76
core/composer/qgsgroupungroupitemscommand.sip
87
core/composer/qgsaddremovemultiframecommand.sip

‎python/core/qgsfeatureiterator.sip

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99

1010

11+
12+
1113
class QgsAbstractFeatureIterator
1214
{
1315
%Docstring
@@ -123,6 +125,33 @@ Setup the simplification of geometries to fetch using the specified simplify met
123125
};
124126

125127

128+
template<T>
129+
class QgsAbstractFeatureIteratorFromSource : QgsAbstractFeatureIterator
130+
{
131+
%Docstring
132+
Helper template that cares of two things: 1. automatic deletion of source if owned by iterator, 2. notification of open/closed iterator.
133+
.. note::
134+
135+
not available in Python bindings (although present in SIP file)
136+
%End
137+
138+
%TypeHeaderCode
139+
#include "qgsfeatureiterator.h"
140+
%End
141+
public:
142+
QgsAbstractFeatureIteratorFromSource( T *source, bool ownSource, const QgsFeatureRequest &request );
143+
144+
~QgsAbstractFeatureIteratorFromSource();
145+
146+
protected:
147+
void iteratorClosed();
148+
%Docstring
149+
to be called by from subclass in close()
150+
%End
151+
152+
};
153+
154+
126155
class QgsFeatureIterator
127156
{
128157
%Docstring
@@ -196,6 +225,9 @@ find out whether the iterator is still valid or closed already
196225
%End
197226

198227

228+
protected:
229+
230+
199231
};
200232

201233

Lines changed: 110 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,147 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsvectorlayerfeatureiterator.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
18

2-
// abstract feature iterator implementations are not part of public API
39

410

11+
12+
13+
14+
%ModuleHeaderCode
15+
#include "qgsfeatureiterator.h"
16+
%End
17+
518
class QgsVectorLayerFeatureSource : QgsAbstractFeatureSource
619
{
20+
%Docstring
21+
Partial snapshot of vector layer's state (only the members necessary for access to features)
22+
%End
23+
724
%TypeHeaderCode
8-
#include <qgsvectorlayerfeatureiterator.h>
25+
#include "qgsvectorlayerfeatureiterator.h"
926
%End
1027
public:
1128

12-
/** Constructor for QgsVectorLayerFeatureSource.
13-
* \param layer source layer
14-
*/
1529
explicit QgsVectorLayerFeatureSource( const QgsVectorLayer *layer );
30+
%Docstring
31+
Constructor for QgsVectorLayerFeatureSource.
32+
\param layer source layer
33+
%End
1634

1735
~QgsVectorLayerFeatureSource();
1836

1937
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() );
20-
QgsFields fields();
38+
39+
40+
QgsFields fields() const;
41+
%Docstring
42+
Returns the fields that will be available for features that are retrieved from
43+
this source.
44+
45+
.. versionadded:: 3.0
46+
:rtype: QgsFields
47+
%End
48+
49+
protected:
50+
51+
52+
53+
54+
55+
56+
2157
};
2258

23-
class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIterator
59+
60+
typedef QgsAbstractFeatureIteratorFromSource<QgsVectorLayerFeatureSource> QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase;
61+
62+
class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase
2463
{
64+
2565
%TypeHeaderCode
26-
#include <qgsvectorlayerfeatureiterator.h>
66+
#include "qgsvectorlayerfeatureiterator.h"
67+
#include "qgsfeatureiterator.h"
68+
typedef QgsAbstractFeatureIteratorFromSource<QgsVectorLayerFeatureSource> QgsAbstractFeatureIteratorFromSourceQgsVectorLayerFeatureSourceBase;
2769
%End
2870
public:
71+
QgsVectorLayerFeatureIterator( QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request );
72+
2973
~QgsVectorLayerFeatureIterator();
3074

31-
//! reset the iterator to the starting position
3275
virtual bool rewind();
76+
%Docstring
77+
reset the iterator to the starting position
78+
:rtype: bool
79+
%End
3380

34-
//! end of iterating: free the resources / lock
3581
virtual bool close();
82+
%Docstring
83+
end of iterating: free the resources / lock
84+
:rtype: bool
85+
%End
86+
87+
88+
struct FetchJoinInfo
89+
{
90+
const QgsVectorLayerJoinInfo *joinInfo;//!< Canonical source of information about the join
91+
QgsAttributeList attributes; //!< Attributes to fetch
92+
int indexOffset; //!< At what position the joined fields start
93+
QgsVectorLayer *joinLayer; //!< Resolved pointer to the joined layer
94+
int targetField; //!< Index of field (of this layer) that drives the join
95+
int joinField; //!< Index of field (of the joined layer) must have equal value
96+
97+
void addJoinedAttributesCached( QgsFeature &f, const QVariant &joinValue ) const;
98+
void addJoinedAttributesDirect( QgsFeature &f, const QVariant &joinValue ) const;
99+
};
100+
36101

37102
protected:
38-
//! fetch next feature, return true on success
39103
virtual bool fetchFeature( QgsFeature &feature );
104+
%Docstring
105+
fetch next feature, return true on success
106+
:rtype: bool
107+
%End
40108

41-
//! Overrides default method as we only need to filter features in the edit buffer
42-
//! while for others filtering is left to the provider implementation.
43109
virtual bool nextFeatureFilterExpression( QgsFeature &f );
110+
%Docstring
111+
while for others filtering is left to the provider implementation.
112+
:rtype: bool
113+
%End
44114

45-
//! Setup the simplification of geometries to fetch using the specified simplify method
46115
virtual bool prepareSimplification( const QgsSimplifyMethod &simplifyMethod );
116+
%Docstring
117+
Setup the simplification of geometries to fetch using the specified simplify method
118+
:rtype: bool
119+
%End
120+
121+
122+
123+
124+
125+
126+
127+
128+
129+
130+
131+
132+
133+
134+
47135

48-
//! @note not available in Python bindings
49-
//void rewindEditBuffer();
50-
//! @note not available in Python bindings
51-
//void prepareJoins();
52-
//! @note not available in Python bindings
53-
//void prepareExpressions();
54-
//! @note not available in Python bindings
55-
//bool fetchNextAddedFeature( QgsFeature &f );
56-
//! @note not available in Python bindings
57-
//bool fetchNextChangedGeomFeature( QgsFeature &f );
58-
//! @note not available in Python bindings
59-
//bool fetchNextChangedAttributeFeature( QgsFeature &f );
60-
//! @note not available in Python bindings
61-
//void useAddedFeature( const QgsFeature &src, QgsFeature &f );
62-
//! @note not available in Python bindings
63-
//void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry &geom, QgsFeature &f );
64-
//! @note not available in Python bindings
65-
//bool nextFeatureFid( QgsFeature &f );
66-
//! @note not available in Python bindings
67-
//void addJoinedAttributes( QgsFeature &f );
68-
69-
/**
70-
* Adds attributes that don't source from the provider but are added inside QGIS
71-
* Includes
72-
* - Joined fields
73-
* - Expression fields
74-
*
75-
* @param f The feature will be modified
76-
* @note not available in Python bindings
77-
*/
78-
//void addVirtualAttributes( QgsFeature &f );
79-
80-
/** Update feature with uncommitted attribute updates.
81-
* @note not available in Python bindings
82-
*/
83-
//void updateChangedAttributes( QgsFeature &f );
84-
85-
/** Update feature with uncommitted geometry updates.
86-
* @note not available in Python bindings
87-
*/
88-
//void updateFeatureGeometry( QgsFeature &f );
89136

90137
private:
91138
QgsVectorLayerFeatureIterator( const QgsVectorLayerFeatureIterator &rhs );
92-
93139
};
140+
141+
/************************************************************************
142+
* This file has been generated automatically from *
143+
* *
144+
* src/core/qgsvectorlayerfeatureiterator.h *
145+
* *
146+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
147+
************************************************************************/

‎scripts/sipify.pl

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
use strict;
33
use warnings;
44
use File::Basename;
5+
use File::Spec;
56
use Getopt::Long;
7+
use YAML::Tiny;
68
no if $] >= 5.018000, warnings => 'experimental::smartmatch';
79

810
use constant PRIVATE => 0;
@@ -17,41 +19,16 @@
1719
die("usage: $0 [-debug] headerfile\n") unless GetOptions ("debug" => \$debug) && @ARGV == 1;
1820
my $headerfile = $ARGV[0];
1921

20-
sub processDoxygenLine
21-
{
22-
my $line = $_[0];
23-
# remove \a formatting
24-
$line =~ s/\\a (.+?)\b/``$1``/g;
25-
# replace :: with . (changes c++ style namespace/class directives to Python style)
26-
$line =~ s/::/./g;
27-
# replace nullptr with None (nullptr means nothing to Python devs)
28-
$line =~ s/\bnullptr\b/None/g;
29-
# replace \returns with :return:
30-
$line =~ s/\\return(s)?/:return:/g;
31-
32-
if ( $line =~ m/[\\@](ingroup|class)/ ) {
33-
return ""
34-
}
35-
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
36-
return ".. versionadded:: $1\n";
37-
}
38-
if ( $line =~ m/\\see (.*)/ ) {
39-
return ".. seealso:: $1\n";
40-
}
41-
if ( $line =~ m/[\\@]note (.*)/ ) {
42-
return ".. note::\n\n $1\n";
43-
}
44-
if ( $line =~ m/[\\@]brief (.*)/ ) {
45-
return " $1\n";
46-
}
47-
return "$line\n";
48-
}
49-
5022
# read file
5123
open(my $handle, "<", $headerfile) || die "Couldn't open '".$headerfile."' for reading because: ".$!;
5224
chomp(my @lines = <$handle>);
5325
close $handle;
5426

27+
# config
28+
my $cfg_file = File::Spec->catfile( dirname(__FILE__), 'sipify.yaml' );
29+
my $yaml = YAML::Tiny->read( $cfg_file );
30+
my $SIP_CONFIG = $yaml->[0];
31+
5532
# contexts
5633
my $SIP_RUN = 0;
5734
my $HEADER_CODE = 0;
@@ -97,6 +74,36 @@ sub dbg_info
9774
}
9875
}
9976

77+
sub processDoxygenLine
78+
{
79+
my $line = $_[0];
80+
# remove \a formatting
81+
$line =~ s/\\a (.+?)\b/``$1``/g;
82+
# replace :: with . (changes c++ style namespace/class directives to Python style)
83+
$line =~ s/::/./g;
84+
# replace nullptr with None (nullptr means nothing to Python devs)
85+
$line =~ s/\bnullptr\b/None/g;
86+
# replace \returns with :return:
87+
$line =~ s/\\return(s)?/:return:/g;
88+
89+
if ( $line =~ m/[\\@](ingroup|class)/ ) {
90+
return ""
91+
}
92+
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
93+
return ".. versionadded:: $1\n";
94+
}
95+
if ( $line =~ m/\\see (.*)/ ) {
96+
return ".. seealso:: $1\n";
97+
}
98+
if ( $line =~ m/[\\@]note (.*)/ ) {
99+
return ".. note::\n\n $1\n";
100+
}
101+
if ( $line =~ m/[\\@]brief (.*)/ ) {
102+
return " $1\n";
103+
}
104+
return "$line\n";
105+
}
106+
100107
sub detect_and_remove_following_body_or_initializerlist {
101108
# https://regex101.com/r/ZaP3tC/6
102109
do {no warnings 'uninitialized';
@@ -441,8 +448,12 @@ sub detect_comment_block{
441448
while (@template_inheritance_template) {
442449
my $tpl = pop @template_inheritance_template;
443450
my $cls = pop @template_inheritance_class;
451+
my $tpl_header = lc $tpl . ".h";
452+
if (exists $SIP_CONFIG->{class_headerfile}->{$tpl}){
453+
$tpl_header = $SIP_CONFIG->{class_headerfile}->{$tpl};
454+
}
444455
$line = "\ntypedef $tpl<$cls> ${tpl}${cls}Base;\n\n$line";
445-
$line .= "\n#include \"" . lc $tpl . ".h\"";
456+
$line .= "\n#include \"" . $tpl_header . "\"";
446457
$line .= "\ntypedef $tpl<$cls> ${tpl}${cls}Base;";
447458
}
448459
if ( PRIVATE ~~ @ACCESS && $#ACCESS != 0){

‎scripts/sipify.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
class_headerfile:
4+
QgsAbstractFeatureIteratorFromSource: qgsfeatureiterator.h

‎src/core/qgsfeatureiterator.h

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,21 @@
1919
#include "qgsfeaturerequest.h"
2020
#include "qgsindexedfeature.h"
2121

22-
#ifndef SIP_RUN
22+
2323

2424
/** \ingroup core
2525
* Interface that can be optionally attached to an iterator so its
2626
* nextFeature() implementaton can check if it must stop as soon as possible.
2727
* \since QGIS 2.16
2828
* \note not available in Python bindings
2929
*/
30-
class CORE_EXPORT QgsInterruptionChecker
30+
class CORE_EXPORT QgsInterruptionChecker SIP_SKIP
3131
{
3232
public:
3333
//! return true if the iterator must stop as soon as possible
3434
virtual bool mustStop() const = 0;
3535
};
3636

37-
#endif
38-
3937
/** \ingroup core
4038
* Internal feature iterator to be implemented within data providers
4139
*/
@@ -65,8 +63,6 @@ class CORE_EXPORT QgsAbstractFeatureIterator
6563
//! end of iterating: free the resources / lock
6664
virtual bool close() = 0;
6765

68-
#ifndef SIP_RUN
69-
7066
/** Attach an object that can be queried regularly by the iterator to check
7167
* if it must stopped. This is mostly useful for iterators where a single
7268
* nextFeature()/fetchFeature() iteration might be very long. A typical use case is the
@@ -75,8 +71,7 @@ class CORE_EXPORT QgsAbstractFeatureIterator
7571
* \since QGIS 2.16
7672
* \note not available in Python bindings
7773
*/
78-
virtual void setInterruptionChecker( QgsInterruptionChecker *interruptionChecker );
79-
#endif
74+
virtual void setInterruptionChecker( QgsInterruptionChecker *interruptionChecker ) SIP_SKIP;
8075

8176
/** Returns the status of expression compilation for filter expression requests.
8277
* \since QGIS 2.16
@@ -179,14 +174,13 @@ class CORE_EXPORT QgsAbstractFeatureIterator
179174
void setupOrderBy( const QList<QgsFeatureRequest::OrderByClause> &orderBys );
180175
};
181176

182-
#ifndef SIP_RUN
183177

184178
/** \ingroup core
185179
* Helper template that cares of two things: 1. automatic deletion of source if owned by iterator, 2. notification of open/closed iterator.
186-
* \note not available in Python bindings
180+
* \note not available in Python bindings (although present in SIP file)
187181
*/
188182
template<typename T>
189-
class QgsAbstractFeatureIteratorFromSource : public QgsAbstractFeatureIterator
183+
class CORE_EXPORT QgsAbstractFeatureIteratorFromSource : public QgsAbstractFeatureIterator

Comment on line R183

nyalldawson commented on May 24, 2017

@nyalldawson
Collaborator

@3nids guess what this broke? ;)

NathanW2 replied on May 24, 2017

@NathanW2
Member

@3nids why do you hate Windows so much :)

(This is a joke, keep up the good work on the sip stuff)

3nids replied on May 24, 2017

@3nids
MemberAuthor

Sorry I did not think it would break the build. Will fix this.

3nids replied on May 24, 2017

@3nids
MemberAuthor

should be fixed in 8157cf6

NathanW2 replied on May 24, 2017

@NathanW2
Member

3nids replied on May 24, 2017

@3nids
MemberAuthor

can I earn some money on each break? that would be even more pleasant!

jef-n replied on May 24, 2017

@jef-n
Member

@3nids "Get out of the fund-raising mode. this is not about money." Scarey bozo.

3nids replied on May 24, 2017

@3nids
MemberAuthor

that one is a must read, would be worth a quotation on QGIS homepage!

jef-n replied on May 24, 2017

@jef-n
Member

btw fix isn't enough - still looking what's wrong.

jef-n replied on May 24, 2017

@jef-n
Member

or it's just ninja not cleaning on "ninja clean" when invoked from VS. We'll see - one fine day I'll check out clcache

jef-n replied on May 24, 2017

@jef-n
Member

Never mind. It's just me. I build for windows and my favorite editor is vim. At least I can manage to exit vim.

NathanW2 replied on May 24, 2017

@NathanW2
Member
Code has comments. Press enter to view.
190184
{
191185
public:
192186
QgsAbstractFeatureIteratorFromSource( T *source, bool ownSource, const QgsFeatureRequest &request )
@@ -211,7 +205,6 @@ class QgsAbstractFeatureIteratorFromSource : public QgsAbstractFeatureIterator
211205
bool mOwnSource;
212206
};
213207

214-
#endif
215208

216209
/**
217210
* \ingroup core
@@ -260,33 +253,26 @@ class CORE_EXPORT QgsFeatureIterator
260253
//! find out whether the iterator is still valid or closed already
261254
bool isClosed() const;
262255

263-
#ifndef SIP_RUN
264-
265256
/** Attach an object that can be queried regularly by the iterator to check
266257
* if it must stopped. This is mostly useful for iterators where a single
267258
* nextFeature()/fetchFeature() iteration might be very long. A typical use case is the
268259
* WFS provider.
269260
* \since QGIS 2.16
270261
* \note not available in Python bindings
271262
*/
272-
void setInterruptionChecker( QgsInterruptionChecker *interruptionChecker );
273-
274-
#endif
263+
void setInterruptionChecker( QgsInterruptionChecker *interruptionChecker ) SIP_SKIP;
275264

276265
/** Returns the status of expression compilation for filter expression requests.
277266
* \since QGIS 2.16
278267
*/
279268
QgsAbstractFeatureIterator::CompileStatus compileStatus() const { return mIter->compileStatus(); }
280269

281-
#ifndef SIP_RUN
282-
283-
friend bool operator== ( const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2 );
284-
friend bool operator!= ( const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2 );
270+
friend bool operator== ( const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2 ) SIP_SKIP;
271+
friend bool operator!= ( const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2 ) SIP_SKIP;
285272

286273
protected:
287274
QgsAbstractFeatureIterator *mIter = nullptr;
288275

289-
#endif
290276

291277
};
292278

‎src/core/qgsvectorlayerfeatureiterator.h

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <QSet>
2525
#include <memory>
2626

27-
typedef QMap<QgsFeatureId, QgsFeature> QgsFeatureMap;
27+
typedef QMap<QgsFeatureId, QgsFeature> QgsFeatureMap SIP_SKIP;
2828

2929
class QgsExpressionFieldBuffer;
3030
class QgsVectorLayer;
@@ -35,6 +35,12 @@ class QgsExpressionContext;
3535

3636
class QgsVectorLayerFeatureIterator;
3737

38+
#ifdef SIP_RUN
39+
% ModuleHeaderCode
40+
#include "qgsfeatureiterator.h"
41+
% End
42+
#endif
43+
3844
/** \ingroup core
3945
* Partial snapshot of vector layer's state (only the members necessary for access to features)
4046
*/
@@ -51,7 +57,7 @@ class CORE_EXPORT QgsVectorLayerFeatureSource : public QgsAbstractFeatureSource
5157

5258
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) override;
5359

54-
friend class QgsVectorLayerFeatureIterator;
60+
friend class QgsVectorLayerFeatureIterator SIP_SKIP;
5561

5662
/**
5763
* Returns the fields that will be available for features that are retrieved from
@@ -101,7 +107,24 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera
101107
//! end of iterating: free the resources / lock
102108
virtual bool close() override;
103109

104-
virtual void setInterruptionChecker( QgsInterruptionChecker *interruptionChecker ) override;
110+
virtual void setInterruptionChecker( QgsInterruptionChecker *interruptionChecker ) override SIP_SKIP;
111+
112+
/** Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes().
113+
* Created in the select() method of QgsVectorLayerJoinBuffer for the joins that contain fetched attributes
114+
*/
115+
struct FetchJoinInfo
116+
{
117+
const QgsVectorLayerJoinInfo *joinInfo;//!< Canonical source of information about the join
118+
QgsAttributeList attributes; //!< Attributes to fetch
119+
int indexOffset; //!< At what position the joined fields start
120+
QgsVectorLayer *joinLayer; //!< Resolved pointer to the joined layer
121+
int targetField; //!< Index of field (of this layer) that drives the join
122+
int joinField; //!< Index of field (of the joined layer) must have equal value
123+
124+
void addJoinedAttributesCached( QgsFeature &f, const QVariant &joinValue ) const;
125+
void addJoinedAttributesDirect( QgsFeature &f, const QVariant &joinValue ) const;
126+
};
127+
105128

106129
protected:
107130
//! fetch next feature, return true on success
@@ -173,22 +196,6 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera
173196
*/
174197
void updateFeatureGeometry( QgsFeature &f ) SIP_SKIP;
175198

176-
/** Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes().
177-
* Created in the select() method of QgsVectorLayerJoinBuffer for the joins that contain fetched attributes
178-
*/
179-
struct FetchJoinInfo
180-
{
181-
const QgsVectorLayerJoinInfo *joinInfo;//!< Canonical source of information about the join
182-
QgsAttributeList attributes; //!< Attributes to fetch
183-
int indexOffset; //!< At what position the joined fields start
184-
QgsVectorLayer *joinLayer; //!< Resolved pointer to the joined layer
185-
int targetField; //!< Index of field (of this layer) that drives the join
186-
int joinField; //!< Index of field (of the joined layer) must have equal value
187-
188-
void addJoinedAttributesCached( QgsFeature &f, const QVariant &joinValue ) const;
189-
void addJoinedAttributesDirect( QgsFeature &f, const QVariant &joinValue ) const;
190-
};
191-
192199
QgsFeatureRequest mProviderRequest;
193200
QgsFeatureIterator mProviderIterator;
194201
QgsFeatureRequest mChangedFeaturesRequest;
@@ -203,13 +210,17 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera
203210

204211
/** Information about joins used in the current select() statement.
205212
Allows faster mapping of attribute ids compared to mVectorJoins */
206-
QMap<const QgsVectorLayerJoinInfo *, FetchJoinInfo> mFetchJoinInfo;
213+
QMap<const QgsVectorLayerJoinInfo *, QgsVectorLayerFeatureIterator::FetchJoinInfo> mFetchJoinInfo;
207214

208215
QMap<int, QgsExpression *> mExpressionFieldInfo;
209216

210217
bool mHasVirtualAttributes;
211218

212219
private:
220+
#ifdef SIP_RUN
221+
QgsVectorLayerFeatureIterator( const QgsVectorLayerFeatureIterator &rhs );
222+
#endif
223+
213224
std::unique_ptr<QgsExpressionContext> mExpressionContext;
214225

215226
QgsInterruptionChecker *mInterruptionChecker = nullptr;

0 commit comments

Comments
 (0)
Please sign in to comment.