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();
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.
virtual bool fetchFeature(QgsFeature &f) override
Implementation for fetching a feature.
QgsFeatureId filterFid() const
Get the feature ID that should be fetched.
FilterType filterType() const
Return the filter type which is currently set on this request.
const QgsFeatureIds & filterFids() const
Get feature IDs that should be fetched.
void requestCompleted(const QgsFeatureRequest &featureRequest, const QgsFeatureIds &fids)
Gets called, whenever the full list of feature ids for a certain request is known.
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...
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
virtual bool close() override
Close this iterator.
QgsFeatureId id() const
Get the feature ID for this feature.
virtual bool rewind() override
Rewind to the beginning of the iterator.
This class caches features of a given QgsVectorLayer.
const_iterator constBegin() const
QgsFeatureRequest mRequest
A copy of the feature request.
QList< Key > keys() const
virtual bool rewind() override
Rewind to the beginning of the iterator.
Q_DECL_DEPRECATED QgsCachedFeatureIterator(QgsVectorLayerCache *vlCache, const QgsFeatureRequest &featureRequest, const QgsFeatureIds &featureIds)
This constructor creates a feature iterator, that delivers only cached information, based on the QgsFeatureIds.
bool nextFeature(QgsFeature &f)
virtual bool fetchFeature(QgsFeature &f) override
Implementation for fetching a feature.
QgsCachedFeatureWriterIterator(QgsVectorLayerCache *vlCache, const QgsFeatureRequest &featureRequest)
This constructor creates a feature iterator, which queries the backend and caches retrieved features...