15#ifndef QGSMEMORYFEATUREITERATOR_H
16#define QGSMEMORYFEATUREITERATOR_H
28class QgsMemoryProvider;
38 explicit QgsMemoryFeatureSource(
const QgsMemoryProvider *p );
47 std::unique_ptr< QgsSpatialIndex > mSpatialIndex;
48 QString mSubsetString;
49 std::unique_ptr< QgsExpressionContext > mExpressionContext;
52 friend class QgsMemoryFeatureIterator;
59 QgsMemoryFeatureIterator( QgsMemoryFeatureSource *source,
bool ownSource,
const QgsFeatureRequest &request );
61 ~QgsMemoryFeatureIterator()
override;
64 bool close()
override;
71 bool nextFeatureUsingList(
QgsFeature &feature );
72 bool nextFeatureTraverseAll(
QgsFeature &feature );
75 std::unique_ptr< QgsGeometryEngine > mSelectRectEngine;
77 std::unique_ptr< QgsGeometryEngine > mDistanceWithinEngine;
79 QgsFeatureMap::const_iterator mSelectIterator;
80 bool mUsingFeatureIdList =
false;
81 QList<QgsFeatureId> mFeatureIdList;
82 QList<QgsFeatureId>::const_iterator mFeatureIdListIterator;
83 std::unique_ptr< QgsExpression > mSubsetExpression;
Helper template that cares of two things: 1.
virtual bool rewind()=0
Resets the iterator to the starting position.
virtual bool fetchFeature(QgsFeature &f)=0
If you write a feature iterator for your provider, this is the method you need to implement!...
virtual bool close()=0
Call to end the iteration.
Base class that can be used for any class that is capable of returning features.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
This class represents a coordinate reference system (CRS).
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Wrapper for iterator of features from vector data provider or vector layer.
This class wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
A spatial index for QgsFeature objects.
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap