QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
15 #ifndef QGSFEATUREITERATOR_H
16 #define QGSFEATUREITERATOR_H
18 #include "qgis_core.h"
50 virtual bool rewind() = 0;
52 virtual bool close() = 0;
92 bool compileFailed()
const;
102 DistanceWithinMustBeCheckedManually,
114 virtual bool fetchFeature(
QgsFeature &f ) = 0;
126 virtual bool nextFeatureFilterExpression(
QgsFeature &f );
139 virtual bool nextFeatureFilterFids(
QgsFeature &f );
181 bool mClosed =
false;
190 bool mZombie =
false;
205 long long mFetchedCount = 0;
210 bool mCompileFailed =
false;
226 bool mUseCachedFeatures =
false;
227 QList<QgsIndexedFeature> mCachedFeatures;
228 QList<QgsIndexedFeature>::ConstIterator mFeatureIterator;
241 virtual bool prepareOrderBy(
const QList<QgsFeatureRequest::OrderByClause> &orderBys );
249 void setupOrderBy(
const QList<QgsFeatureRequest::OrderByClause> &orderBys );
267 mSource->iteratorOpened(
this );
301 std::unique_ptr< QgsFeature > f = std::make_unique< QgsFeature >();
303 Py_BEGIN_ALLOW_THREADS
304 result = ( sipCpp->nextFeature( *f ) );
307 sipRes = sipConvertFromType( f.release(), sipType_QgsFeature, Py_None );
310 PyErr_SetString( PyExc_StopIteration,
"" );
339 bool isValid()
const;
342 bool isClosed()
const;
432 return !( fi1 == fi2 );
443 #endif // QGSFEATUREITERATOR_H
@ Compiled
Expression was fully compiled and delegated to data provider source.
RequestToSourceCrsResult
Possible results from the updateRequestToSourceCrs() method.
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
virtual void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
virtual bool isValid() const
Returns if this iterator is valid.
void iteratorClosed()
to be called by from subclass in close()
bool mClosed
Sets to true, as soon as the iterator is closed.
long long mFetchedCount
Number of features already fetched by iterator.
QgsFeatureRequest mRequest
A copy of the feature request.
bool isClosed() const
find out whether the iterator is still valid or closed already
virtual bool nextFeature(QgsFeature &f)
fetch next feature, return true on success
bool compileFailed() const
Indicator if there was an error when sending the compiled query to the server.
QgsAbstractFeatureIterator::CompileStatus compileStatus() const
Returns the status of expression compilation for filter expression requests.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
A rectangle specified with double values.
QgsAbstractFeatureIteratorFromSource(T *source, bool ownSource, const QgsFeatureRequest &request)
#define SIP_TYPEHINT(type)
Helper template that cares of two things: 1. automatic deletion of source if owned by iterator,...
This class wraps a request for features to a vector layer (or directly its vector data provider).
bool mZombie
A feature iterator may be closed already but still be serving features from the cache.
Custom exception class for Coordinate Reference System related exceptions.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
~QgsAbstractFeatureIteratorFromSource() override
@ PartiallyCompiled
Expression was partially compiled, but extra checks need to be applied to features.
~QgsFeatureIterator()
Destructor deletes the iterator if it has no more references.
virtual bool rewind()=0
reset the iterator to the starting position
CompileStatus
Status of expression compilation for filter expression requests.
bool nextFeature(QgsFeature &f)
void deref()
Remove reference, delete if refs == 0.
QgsFeatureIterator()=default
Construct invalid iterator.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped.
@ NoCompilation
Expression could not be compiled or not attempt was made to compile expression.
QgsAbstractFeatureIterator * mIter
CompileStatus compileStatus() const
Returns the status of expression compilation for filter expression requests.
Wrapper for iterator of features from vector data provider or vector layer.
Internal feature iterator to be implemented within data providers.
virtual bool close()=0
end of iterating: free the resources / lock