QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsFeatureStore Class Reference

A container for features with the same fields and crs. More...

#include <qgsfeaturestore.h>

Inheritance diagram for QgsFeatureStore:
Inheritance graph
[legend]

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 > &parameters)
 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< FlagFlags
 
enum  SinkFlag { RegeneratePrimaryKey = 1 << 1 }
 Flags that can be set on a QgsFeatureSink. More...
 
typedef QFlags< SinkFlagSinkFlags
 

Detailed Description

A container for features with the same fields and crs.

Definition at line 32 of file qgsfeaturestore.h.

Constructor & Destructor Documentation

◆ QgsFeatureStore() [1/2]

QgsFeatureStore::QgsFeatureStore ( )
default

◆ QgsFeatureStore() [2/2]

QgsFeatureStore::QgsFeatureStore ( const QgsFields fields,
const QgsCoordinateReferenceSystem crs 
)

Constructor.

Definition at line 19 of file qgsfeaturestore.cpp.

Member Function Documentation

◆ addFeature()

bool QgsFeatureStore::addFeature ( QgsFeature feature,
QgsFeatureSink::Flags  flags = QgsFeatureSink::Flags() 
)
overridevirtual

Adds a single feature to the sink.

Feature addition behavior is controlled by the specified flags.

See also
addFeatures()
Returns
true in case of success and false in case of failure

Reimplemented from QgsFeatureSink.

Definition at line 35 of file qgsfeaturestore.cpp.

◆ addFeatures()

bool QgsFeatureStore::addFeatures ( QgsFeatureList features,
QgsFeatureSink::Flags  flags = QgsFeatureSink::Flags() 
)
overridevirtual

Adds a list of features to the sink.

Feature addition behavior is controlled by the specified flags.

See also
addFeature()
Returns
true in case of success and false in case of failure

Implements QgsFeatureSink.

Definition at line 43 of file qgsfeaturestore.cpp.

◆ count()

int QgsFeatureStore::count ( ) const
inline

Returns the number of features contained in the store.

Definition at line 70 of file qgsfeaturestore.h.

◆ crs()

QgsCoordinateReferenceSystem QgsFeatureStore::crs ( ) const
inline

Returns the store's coordinate reference system.

See also
setCrs()

Definition at line 56 of file qgsfeaturestore.h.

◆ features()

QgsFeatureList QgsFeatureStore::features ( ) const
inline

Returns the list of features contained in the store.

Definition at line 92 of file qgsfeaturestore.h.

◆ fields()

QgsFields QgsFeatureStore::fields ( ) const
inline

Returns the store's field list.

See also
setFields()

Definition at line 44 of file qgsfeaturestore.h.

◆ params()

QMap< QString, QVariant > QgsFeatureStore::params ( ) const
inline

Returns the map of optional parameters.

See also
setParams()

Definition at line 104 of file qgsfeaturestore.h.

◆ setCrs()

void QgsFeatureStore::setCrs ( const QgsCoordinateReferenceSystem crs)
inline

Sets the store's crs.

See also
crs()

Definition at line 62 of file qgsfeaturestore.h.

◆ setFields()

void QgsFeatureStore::setFields ( const QgsFields fields)

Sets the store's fields.

Every contained feature's fields will be reset to match fields.

See also
fields()

Definition at line 25 of file qgsfeaturestore.cpp.

◆ setParams()

void QgsFeatureStore::setParams ( const QMap< QString, QVariant > &  parameters)
inline

Sets a map of optional parameters for the store.

See also
params()

Definition at line 98 of file qgsfeaturestore.h.


The documentation for this class was generated from the following files: