QGIS API Documentation
3.14.0-Pi (9f7028fd23)
src
core
qgscachedfeatureiterator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgscachedfeatureiterator.h
3
--------------------------------------
4
Date : 12.2.2013
5
Copyright : (C) 2013 Matthias Kuhn
6
Email : matthias at opengis dot ch
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 QGSCACHEDFEATUREITERATOR_H
17
#define QGSCACHEDFEATUREITERATOR_H
18
19
#include "qgis_core.h"
20
#include "
qgsfeature.h
"
21
#include "
qgsfeatureiterator.h
"
22
23
class
QgsVectorLayerCache
;
24
31
class
CORE_EXPORT
QgsCachedFeatureIterator
:
public
QgsAbstractFeatureIterator
32
{
33
public
:
34
41
QgsCachedFeatureIterator
(
QgsVectorLayerCache
*vlCache,
const
QgsFeatureRequest
&featureRequest );
42
48
bool
rewind
()
override
;
49
55
bool
close
()
override
;
56
57
// QgsAbstractFeatureIterator interface
58
protected
:
59
68
bool
fetchFeature
(
QgsFeature
&f )
override
;
69
76
bool
nextFeatureFilterFids
(
QgsFeature
&f )
override
{
return
fetchFeature
( f ); }
77
78
private
:
79
QgsFeatureIds
mFeatureIds;
80
QgsVectorLayerCache
*mVectorLayerCache =
nullptr
;
81
QgsFeatureIds::ConstIterator mFeatureIdIterator;
82
QgsCoordinateTransform
mTransform;
83
QgsRectangle
mFilterRect;
84
};
85
92
class
CORE_EXPORT
QgsCachedFeatureWriterIterator
:
public
QgsAbstractFeatureIterator
93
{
94
public
:
95
102
QgsCachedFeatureWriterIterator
(
QgsVectorLayerCache
*vlCache,
const
QgsFeatureRequest
&featureRequest );
103
109
bool
rewind
()
override
;
110
116
bool
close
()
override
;
117
118
protected
:
119
128
bool
fetchFeature
(
QgsFeature
&f )
override
;
129
130
private
:
131
QgsFeatureIterator
mFeatIt;
132
QgsVectorLayerCache
*mVectorLayerCache =
nullptr
;
133
QgsFeatureIds
mFids;
134
QgsCoordinateTransform
mTransform;
135
QgsRectangle
mFilterRect;
136
};
137
#endif // QGSCACHEDFEATUREITERATOR_H
QgsCachedFeatureWriterIterator
Uses another iterator as backend and writes features to the cache.
Definition:
qgscachedfeatureiterator.h:92
QgsVectorLayerCache
The cached features can be indexed by QgsAbstractCacheIndex.
Definition:
qgsvectorlayercache.h:45
qgsfeatureiterator.h
qgsfeature.h
QgsRectangle
Definition:
qgsrectangle.h:41
QgsFeatureRequest
Definition:
qgsfeaturerequest.h:75
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition:
qgsfeatureid.h:34
QgsAbstractFeatureIterator::rewind
virtual bool rewind()=0
reset the iterator to the starting position
QgsCachedFeatureIterator
Delivers features from the cache.
Definition:
qgscachedfeatureiterator.h:31
QgsAbstractFeatureIterator::fetchFeature
virtual bool fetchFeature(QgsFeature &f)=0
If you write a feature iterator for your provider, this is the method you need to implement!...
QgsFeature
Definition:
qgsfeature.h:55
QgsCoordinateTransform
Definition:
qgscoordinatetransform.h:52
QgsCachedFeatureIterator::nextFeatureFilterFids
bool nextFeatureFilterFids(QgsFeature &f) override
We have a local special iterator for FilterFids, no need to run the generic.
Definition:
qgscachedfeatureiterator.h:76
QgsFeatureIterator
Definition:
qgsfeatureiterator.h:263
QgsAbstractFeatureIterator
Definition:
qgsfeatureiterator.h:28
QgsAbstractFeatureIterator::close
virtual bool close()=0
end of iterating: free the resources / lock
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17