QGIS API Documentation 3.41.0-Master (d5b93354e9c)
|
A container for features with the same fields and crs. More...
#include <qgsfeaturestore.h>
Public Member Functions | |
QgsFeatureStore ()=default | |
QgsFeatureStore (const QgsFields &fields, const QgsCoordinateReferenceSystem &crs) | |
Constructor. | |
bool | addFeature (QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
Adds a single feature to the sink. | |
bool | addFeatures (QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override |
Adds a list of features to the sink. | |
int | count () const |
Returns the number of features contained in the store. | |
QgsCoordinateReferenceSystem | crs () const |
Returns the store's coordinate reference system. | |
QgsFeatureList | features () const |
Returns the list of features contained in the store. | |
QgsFields | fields () const |
Returns the store's field list. | |
QMap< QString, QVariant > | params () const |
Returns the map of optional parameters. | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the store's crs. | |
void | setFields (const QgsFields &fields) |
Sets the store's fields. | |
void | setParams (const QMap< QString, QVariant > ¶meters) |
Sets a map of optional parameters for the store. | |
Public Member Functions inherited from QgsFeatureSink | |
virtual | ~QgsFeatureSink ()=default |
virtual bool | addFeatures (QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) |
Adds all features from the specified iterator to the sink. | |
virtual void | finalize () |
Finalizes the sink, flushing any buffered features to the destination. | |
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. | |
virtual QString | lastError () const |
Returns the most recent error encountered by the sink, e.g. | |
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... | |
typedef QFlags< Flag > | Flags |
enum | SinkFlag { RegeneratePrimaryKey = 1 << 1 } |
Flags that can be set on a QgsFeatureSink. More... | |
typedef QFlags< SinkFlag > | SinkFlags |
A container for features with the same fields and crs.
Definition at line 32 of file qgsfeaturestore.h.
|
default |
QgsFeatureStore::QgsFeatureStore | ( | const QgsFields & | fields, |
const QgsCoordinateReferenceSystem & | crs | ||
) |
Constructor.
Definition at line 19 of file qgsfeaturestore.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 QgsFeatureSink.
Definition at line 35 of file qgsfeaturestore.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 Implements QgsFeatureSink.
Definition at line 43 of file qgsfeaturestore.cpp.
|
inline |
Returns the number of features contained in the store.
Definition at line 70 of file qgsfeaturestore.h.
|
inline |
Returns the store's coordinate reference system.
Definition at line 56 of file qgsfeaturestore.h.
|
inline |
Returns the list of features contained in the store.
Definition at line 92 of file qgsfeaturestore.h.
|
inline |
Returns the store's field list.
Definition at line 44 of file qgsfeaturestore.h.
|
inline |
Returns the map of optional parameters.
Definition at line 104 of file qgsfeaturestore.h.
|
inline |
void QgsFeatureStore::setFields | ( | const QgsFields & | fields | ) |
Sets the store's fields.
Every contained feature's fields will be reset to match fields.
Definition at line 25 of file qgsfeaturestore.cpp.
|
inline |
Sets a map of optional parameters for the store.
Definition at line 98 of file qgsfeaturestore.h.