18 #ifndef QGSFEATURESINK_H 19 #define QGSFEATURESINK_H 21 #include "qgis_core.h" 50 Q_DECLARE_FLAGS( Flags,
Flag )
59 virtual bool addFeature(
QgsFeature &feature, QgsFeatureSink::Flags flags =
nullptr );
66 virtual bool addFeatures(
QgsFeatureList &features, QgsFeatureSink::Flags flags =
nullptr ) = 0;
72 virtual bool addFeatures(
QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags =
nullptr );
81 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureSink::Flags )
105 bool addFeature(
QgsFeature &feature, QgsFeatureSink::Flags flags =
nullptr )
override {
return mSink->addFeature( feature, flags ); }
106 bool addFeatures(
QgsFeatureList &features, QgsFeatureSink::Flags flags =
nullptr )
override {
return mSink->addFeatures( features, flags ); }
121 #endif // QGSFEATURESINK_H Wrapper for iterator of features from vector data provider or vector layer.
A simple feature sink which proxies feature addition on to another feature sink.
QList< QgsFeature > QgsFeatureList
An interface for objects which accept features via addFeature(s) methods.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Q_DECLARE_METATYPE(QModelIndex)
bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr) override
Adds a list of features to the sink.
bool addFeatures(QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags=nullptr) override
Adds all features from the specified iterator to the sink.
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
Flag
Flags controlling how features are added to a sink.
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr) override
Adds a single feature to the sink.
QgsFeatureSink * destinationSink()
Returns the destination QgsFeatureSink which the proxy will forward features to.