15 #ifndef QGSMEMORYFEATUREITERATOR_H
16 #define QGSMEMORYFEATUREITERATOR_H
27 class QgsMemoryProvider;
37 explicit QgsMemoryFeatureSource(
const QgsMemoryProvider *p );
46 std::unique_ptr< QgsSpatialIndex > mSpatialIndex;
47 QString mSubsetString;
48 std::unique_ptr< QgsExpressionContext > mExpressionContext;
51 friend class QgsMemoryFeatureIterator;
58 QgsMemoryFeatureIterator( QgsMemoryFeatureSource *source,
bool ownSource,
const QgsFeatureRequest &request );
60 ~QgsMemoryFeatureIterator()
override;
63 bool close()
override;
70 bool nextFeatureUsingList(
QgsFeature &feature );
71 bool nextFeatureTraverseAll(
QgsFeature &feature );
74 std::unique_ptr< QgsGeometryEngine > mSelectRectEngine;
76 QgsFeatureMap::const_iterator mSelectIterator;
77 bool mUsingFeatureIdList =
false;
78 QList<QgsFeatureId> mFeatureIdList;
79 QList<QgsFeatureId>::const_iterator mFeatureIdListIterator;
80 std::unique_ptr< QgsExpression > mSubsetExpression;
Helper template that cares of two things: 1.
virtual bool rewind()=0
reset 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
end of iterating: free the resources / lock
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 id, geometry and a list of field/values...
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