QGIS API Documentation 3.41.0-Master (3c143d501a8)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
QgsCachedFeatureIterator Class Reference

Delivers features from the cache. More...

#include <qgscachedfeatureiterator.h>

Inheritance diagram for QgsCachedFeatureIterator:
Inheritance graph
[legend]

Public Member Functions

 QgsCachedFeatureIterator (QgsVectorLayerCache *vlCache, const QgsFeatureRequest &featureRequest)
 This constructor creates a feature iterator, that delivers all cached features.
 
 ~QgsCachedFeatureIterator () override
 
bool close () override
 Close this iterator.
 
bool rewind () override
 Rewind to the beginning of the iterator.
 
- Public Member Functions inherited from QgsAbstractFeatureIterator
 QgsAbstractFeatureIterator (const QgsFeatureRequest &request)
 base class constructor - stores the iteration parameters
 
virtual ~QgsAbstractFeatureIterator ()=default
 destructor makes sure that the iterator is closed properly
 
bool compileFailed () const
 Indicator if there was an error when sending the compiled query to the server.
 
CompileStatus compileStatus () const
 Returns the status of expression compilation for filter expression requests.
 
virtual bool isValid () const
 Returns if this iterator is valid.
 
virtual bool nextFeature (QgsFeature &f)
 Fetch next feature and stores in f, returns true on success.
 
virtual void setInterruptionChecker (QgsFeedback *interruptionChecker)
 Attach an object that can be queried regularly by the iterator to check if it must stopped.
 

Protected Member Functions

bool fetchFeature (QgsFeature &f) override
 Implementation for fetching a feature.
 
bool nextFeatureFilterFids (QgsFeature &f) override
 We have a local special iterator for FilterFids, no need to run the generic.
 
- Protected Member Functions inherited from QgsAbstractFeatureIterator
void deref ()
 Remove reference, delete if refs == 0.
 
QgsRectangle filterRectToSourceCrs (const QgsCoordinateTransform &transform) const
 Returns a rectangle representing the original request's QgsFeatureRequest::filterRect().
 
void geometryToDestinationCrs (QgsFeature &feature, const QgsCoordinateTransform &transform) const
 Transforms feature's geometry according to the specified coordinate transform.
 
virtual bool nextFeatureFilterExpression (QgsFeature &f)
 By default, the iterator will fetch all features and check if the feature matches the expression.
 
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod)
 Setup the simplification of geometries to fetch using the specified simplify method.
 
void ref ()
 Add reference.
 
RequestToSourceCrsResult updateRequestToSourceCrs (QgsFeatureRequest &request, const QgsCoordinateTransform &transform) const
 Update a QgsFeatureRequest so that spatial filters are transformed to the source's coordinate reference system.
 

Additional Inherited Members

- Public Types inherited from QgsAbstractFeatureIterator
enum  CompileStatus { NoCompilation , PartiallyCompiled , Compiled }
 Status of expression compilation for filter expression requests. More...
 
enum class  RequestToSourceCrsResult : int { Success , DistanceWithinMustBeCheckedManually }
 Possible results from the updateRequestToSourceCrs() method. More...
 
- Protected Attributes inherited from QgsAbstractFeatureIterator
bool mClosed = false
 Sets to true, as soon as the iterator is closed.
 
bool mCompileFailed = false
 
CompileStatus mCompileStatus = NoCompilation
 Status of compilation of filter expression.
 
long long mFetchedCount = 0
 Number of features already fetched by iterator.
 
QgsFeatureRequest mRequest
 A copy of the feature request.
 
bool mValid = true
 An invalid state of a feature iterator indicates that there was a problem with even getting it up and running.
 
bool mZombie = false
 A feature iterator may be closed already but still be serving features from the cache.
 
int refs = 0
 reference counting (to allow seamless copying of QgsFeatureIterator instances)
 

Detailed Description

Delivers features from the cache.

Definition at line 34 of file qgscachedfeatureiterator.h.

Constructor & Destructor Documentation

◆ QgsCachedFeatureIterator()

QgsCachedFeatureIterator::QgsCachedFeatureIterator ( QgsVectorLayerCache vlCache,
const QgsFeatureRequest featureRequest 
)

This constructor creates a feature iterator, that delivers all cached features.

No request is made to the backend.

Parameters
vlCacheThe vector layer cache to use
featureRequestThe feature request to answer

Definition at line 22 of file qgscachedfeatureiterator.cpp.

◆ ~QgsCachedFeatureIterator()

QgsCachedFeatureIterator::~QgsCachedFeatureIterator ( )
overridedefault

Member Function Documentation

◆ close()

bool QgsCachedFeatureIterator::close ( )
overridevirtual

Close this iterator.

No further features will be available.

Returns
true if successful

Implements QgsAbstractFeatureIterator.

Definition at line 132 of file qgscachedfeatureiterator.cpp.

◆ fetchFeature()

bool QgsCachedFeatureIterator::fetchFeature ( QgsFeature f)
overrideprotectedvirtual

Implementation for fetching a feature.

Parameters
fWill write to this feature
Returns
bool true if the operation was OK

Implements QgsAbstractFeatureIterator.

Definition at line 89 of file qgscachedfeatureiterator.cpp.

◆ nextFeatureFilterFids()

bool QgsCachedFeatureIterator::nextFeatureFilterFids ( QgsFeature f)
inlineoverrideprotectedvirtual

We have a local special iterator for FilterFids, no need to run the generic.

Parameters
fWill write to this feature
Returns
bool true if the operation was OK

Reimplemented from QgsAbstractFeatureIterator.

Definition at line 79 of file qgscachedfeatureiterator.h.

◆ rewind()

bool QgsCachedFeatureIterator::rewind ( )
overridevirtual

Rewind to the beginning of the iterator.

Returns
bool true if the operation was OK

Implements QgsAbstractFeatureIterator.

Definition at line 126 of file qgscachedfeatureiterator.cpp.


The documentation for this class was generated from the following files: