Class: QgsCachedFeatureIterator

Delivers features from the cache.

Class Hierarchy

Inheritance diagram of qgis.core.QgsCachedFeatureIterator

Base classes

QgsAbstractFeatureIterator

Internal feature iterator to be implemented within data providers.

class qgis.core.QgsCachedFeatureIterator[source]

Bases: QgsAbstractFeatureIterator

__init__(vlCache: QgsVectorLayerCache | None, featureRequest: QgsFeatureRequest)

This constructor creates a feature iterator, that delivers all cached features. No request is made to the backend.

Parameters:
abstract close(self) bool[source]

Close this iterator. No further features will be available.

Return type:

bool

Returns:

True if successful

abstract fetchFeature(self, f: QgsFeature) bool[source]

Implementation for fetching a feature.

Parameters:

f (QgsFeature) – Will write to this feature

Return type:

bool

Returns:

bool True if the operation was OK

virtual nextFeatureFilterFids(self, f: QgsFeature) bool[source]

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

Parameters:

f (QgsFeature) – Will write to this feature

Return type:

bool

Returns:

bool True if the operation was OK

abstract rewind(self) bool[source]

Rewind to the beginning of the iterator

Return type:

bool

Returns:

bool True if the operation was OK