21 , mFeatureIds( featureIds )
22 , mVectorLayerCache( vlCache )
26 if ( mFeatureIdIterator == featureIds.
constEnd() )
32 , mVectorLayerCache( vlCache )
45 mFeatureIds = mVectorLayerCache->mCache.
keys().toSet();
51 if ( mFeatureIdIterator == mFeatureIds.
constEnd() )
60 while ( mFeatureIdIterator != mFeatureIds.
constEnd() )
62 f =
QgsFeature( *mVectorLayerCache->mCache[*mFeatureIdIterator]->feature() );
86 , mVectorLayerCache( vlCache )
96 mVectorLayerCache->cacheFeature( f );
118 return mFeatIt.
close();
QgsFeatureId id() const
Get the feature ID for this feature.
bool acceptFeature(const QgsFeature &feature)
Check if a feature is accepted by this requests filter.
Filter using feature IDs.
QSet< QgsFeatureId > QgsFeatureIds
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
const QgsFeatureIds & filterFids() const
virtual bool fetchFeature(QgsFeature &f) override
Implementation for fetching a feature.
QgsVectorLayer * layer()
Returns the layer to which this cache belongs.
bool mClosed
Set to true, as soon as the iterator is closed.
const_iterator insert(const T &value)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsCachedFeatureIterator(QgsVectorLayerCache *vlCache, QgsFeatureRequest featureRequest, QgsFeatureIds featureIds)
This constructor creates a feature iterator, that delivers only cached information, based on the QgsFeatureIds.
Internal feature iterator to be implemented within data providers.
virtual bool close() override
Close this iterator.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
const_iterator constEnd() const
FilterType filterType() const
virtual bool close() override
Close this iterator.
virtual bool rewind() override
Rewind to the beginning of the iterator.
This class caches features of a given QgsVectorLayer.
const_iterator constBegin() const
const QgsFeatureId & filterFid() const
QgsFeatureRequest mRequest
A copy of the feature request.
QList< Key > keys() const
virtual bool rewind() override
Rewind to the beginning of the iterator.
void requestCompleted(QgsFeatureRequest featureRequest, QgsFeatureIds fids)
Gets called, whenever the full list of feature ids for a certain request is known.
bool nextFeature(QgsFeature &f)
QgsCachedFeatureWriterIterator(QgsVectorLayerCache *vlCache, QgsFeatureRequest featureRequest)
This constructor creates a feature iterator, which queries the backend and caches retrieved features...
virtual bool fetchFeature(QgsFeature &f) override
Implementation for fetching a feature.