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.

Abstract Methods

close

Close this iterator.

fetchFeature

Implementation for fetching a feature.

rewind

Rewind to the beginning of the iterator

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsCachedFeatureIterator. See the FAQ for more details.

nextFeatureFilterFids

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

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