QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
QgsProxyFeatureSink subclass which reports feature addition errors to a QgsProcessingContext. More...
#include <qgsprocessingutils.h>
Public Member Functions | |
QgsProcessingFeatureSink (QgsFeatureSink *originalSink, const QString &sinkName, QgsProcessingContext &context, bool ownsOriginalSink=false) | |
Constructor for QgsProcessingFeatureSink, accepting an original feature sink originalSink and processing context. More... | |
~QgsProcessingFeatureSink () override | |
bool | addFeature (QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
Adds a single feature to the sink. More... | |
bool | addFeatures (QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
Adds all features from the specified iterator to the sink. More... | |
bool | addFeatures (QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
Adds a list of features to the sink. More... | |
Public Member Functions inherited from QgsProxyFeatureSink | |
QgsProxyFeatureSink (QgsFeatureSink *sink) | |
Constructs a new QgsProxyFeatureSink which forwards features onto a destination sink. More... | |
QgsFeatureSink * | destinationSink () |
Returns the destination QgsFeatureSink which the proxy will forward features to. More... | |
QString | lastError () const override |
Returns the most recent error encountered by the sink, e.g. More... | |
Public Member Functions inherited from QgsFeatureSink | |
virtual | ~QgsFeatureSink ()=default |
virtual bool | flushBuffer () |
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink's destination. More... | |
Additional Inherited Members | |
Public Types inherited from QgsFeatureSink | |
enum | Flag { FastInsert = 1 << 1 , RollBackOnErrors = 1 << 2 } |
Flags controlling how features are added to a sink. More... | |
enum | SinkFlag { RegeneratePrimaryKey = 1 << 1 } |
Flags that can be set on a QgsFeatureSink. More... | |
QgsProxyFeatureSink subclass which reports feature addition errors to a QgsProcessingContext.
Definition at line 554 of file qgsprocessingutils.h.
QgsProcessingFeatureSink::QgsProcessingFeatureSink | ( | QgsFeatureSink * | originalSink, |
const QString & | sinkName, | ||
QgsProcessingContext & | context, | ||
bool | ownsOriginalSink = false |
||
) |
Constructor for QgsProcessingFeatureSink, accepting an original feature sink originalSink and processing context.
Any added features are added to the originalSink, with feature writing errors being reports to context.
The context must exist for the lifetime of this object.
The sinkName is used to identify the destination sink when reporting errors.
Ownership of originalSink is dictated by ownsOriginalSource. If ownsOriginalSink is false
, ownership is not transferred, and callers must ensure that originalSink exists for the lifetime of this object. If ownsOriginalSink is true
, then this object will take ownership of originalSink.
Definition at line 1393 of file qgsprocessingutils.cpp.
|
override |
Definition at line 1400 of file qgsprocessingutils.cpp.
|
overridevirtual |
Adds a single feature to the sink.
Feature addition behavior is controlled by the specified flags.
true
in case of success and false
in case of failure Reimplemented from QgsProxyFeatureSink.
Definition at line 1406 of file qgsprocessingutils.cpp.
|
overridevirtual |
Adds all features from the specified iterator to the sink.
Feature addition behavior is controlled by the specified flags.
true
if all features were added successfully, or false
if any feature could not be added Reimplemented from QgsProxyFeatureSink.
Definition at line 1434 of file qgsprocessingutils.cpp.
|
overridevirtual |
Adds a list of features to the sink.
Feature addition behavior is controlled by the specified flags.
true
in case of success and false
in case of failure Reimplemented from QgsProxyFeatureSink.
Definition at line 1420 of file qgsprocessingutils.cpp.