15 #ifndef QGSFEATUREITERATOR_H 16 #define QGSFEATUREITERATOR_H 40 virtual bool rewind() = 0;
42 virtual bool close() = 0;
52 virtual bool fetchFeature(
QgsFeature& f ) = 0;
64 virtual bool nextFeatureFilterExpression(
QgsFeature &f );
77 virtual bool nextFeatureFilterFids(
QgsFeature & f );
111 bool mLocalSimplification;
113 bool mUseCachedFeatures;
154 mSource->iteratorOpened(
this );
196 bool isClosed()
const;
265 return !( fi1 == fi2 );
268 #endif // QGSFEATUREITERATOR_H
Wrapper for iterator of features from vector data provider or vector layer.
virtual bool close()=0
end of iterating: free the resources / lock
long mFetchedCount
Number of features already fetched by iterator.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
virtual bool rewind()=0
reset the iterator to the starting position
~QgsAbstractFeatureIteratorFromSource()
bool mClosed
Set to true, as soon as the iterator is closed.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
friend bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool isClosed() const
find out whether the iterator is still valid or closed already
void iteratorClosed()
to be called by from subclass in close()
virtual bool nextFeature(QgsFeature &f)
fetch next feature, return true on success
Internal feature iterator to be implemented within data providers.
QgsFeatureIterator()
construct invalid iterator
bool mZombie
A feature iterator may be closed already but still be serving features from the cache.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
void deref()
remove reference, delete if refs == 0
friend bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QgsFeatureRequest mRequest
A copy of the feature request.
QgsAbstractFeatureIterator * mIter
~QgsFeatureIterator()
destructor deletes the iterator if it has no more references
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
int refs
reference counting (to allow seamless copying of QgsFeatureIterator instances) TODO QGIS3: make this ...
bool nextFeature(QgsFeature &f)
Abstract base class for simplify geometries using a specific algorithm.
QgsAbstractFeatureIteratorFromSource(T *source, bool ownSource, const QgsFeatureRequest &request)
Helper template that cares of two things: 1.