QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | List of all members
QgsVectorDataProviderFeaturePool Class Reference

A feature pool based on a vector data provider. More...

#include <qgsvectordataproviderfeaturepool.h>

Inheritance diagram for QgsVectorDataProviderFeaturePool:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorDataProviderFeaturePool (QgsVectorLayer *layer, bool selectedOnly=false)
 Creates a new feature pool for the data provider of layer. More...
 
bool addFeature (QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
 Adds a single feature to the sink. More...
 
bool addFeatures (QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
 Adds a list of features to the sink. More...
 
void deleteFeature (QgsFeatureId fid) override
 Removes a feature from this pool. More...
 
void updateFeature (QgsFeature &feature) override
 Updates a feature in this pool. More...
 
- Public Member Functions inherited from QgsFeaturePool
 QgsFeaturePool (QgsVectorLayer *layer)
 Creates a new feature pool for layer. More...
 
virtual ~QgsFeaturePool ()=default
 
QgsFeatureIds allFeatureIds () const
 Returns the complete set of feature ids in this pool. More...
 
QgsCoordinateReferenceSystem crs () const
 The coordinate reference system of this layer. More...
 
QgsWkbTypes::GeometryType geometryType () const
 The geometry type of this layer. More...
 
bool getFeature (QgsFeatureId id, QgsFeature &feature)
 Retrieves the feature with the specified id into feature. More...
 
QgsFeatureIds getFeatures (const QgsFeatureRequest &request, QgsFeedback *feedback=nullptr)
 Gets features for the provided request. More...
 
QgsFeatureIds getIntersects (const QgsRectangle &rect) const
 Gets all feature ids in the bounding box rect. More...
 
QgsVectorLayerlayer () const
 Gets a pointer to the underlying layer. More...
 
QString layerId () const
 The layer id of the layer. More...
 
QString layerName () const
 Returns the name of the layer. More...
 
QPointer< QgsVectorLayerlayerPtr () const
 Gets a QPointer to the underlying layer. More...
 
- 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. More...
 
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...
 
virtual QString lastError () const
 Returns the most recent error encountered by the sink, e.g. 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...
 
- Protected Member Functions inherited from QgsFeaturePool
void insertFeature (const QgsFeature &feature, bool skipLock=false)
 Inserts a feature into the cache and the spatial index. More...
 
bool isFeatureCached (QgsFeatureId fid)
 Checks if the feature fid is cached. More...
 
void refreshCache (const QgsFeature &feature)
 Changes a feature in the cache and the spatial index. More...
 
void removeFeature (const QgsFeatureId featureId)
 Removes a feature from the cache and the spatial index. More...
 
void setFeatureIds (const QgsFeatureIds &ids)
 Sets all the feature ids governed by this feature pool. More...
 

Detailed Description

A feature pool based on a vector data provider.

Since
QGIS 3.4

Definition at line 30 of file qgsvectordataproviderfeaturepool.h.

Constructor & Destructor Documentation

◆ QgsVectorDataProviderFeaturePool()

QgsVectorDataProviderFeaturePool::QgsVectorDataProviderFeaturePool ( QgsVectorLayer layer,
bool  selectedOnly = false 
)

Creates a new feature pool for the data provider of layer.

If selectedOnly is set to true, only selected features will be managed by the pool.

Definition at line 21 of file qgsvectordataproviderfeaturepool.cpp.

Member Function Documentation

◆ addFeature()

bool QgsVectorDataProviderFeaturePool::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 51 of file qgsvectordataproviderfeaturepool.cpp.

◆ addFeatures()

bool QgsVectorDataProviderFeaturePool::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 91 of file qgsvectordataproviderfeaturepool.cpp.

◆ deleteFeature()

void QgsVectorDataProviderFeaturePool::deleteFeature ( QgsFeatureId  fid)
overridevirtual

Removes a feature from this pool.

Implementations will remove the feature from the layer or from the data provider.

Implements QgsFeaturePool.

Definition at line 158 of file qgsvectordataproviderfeaturepool.cpp.

◆ updateFeature()

void QgsVectorDataProviderFeaturePool::updateFeature ( QgsFeature feature)
overridevirtual

Updates a feature in this pool.

Implementations will update the feature on the layer or on the data provider.

Implements QgsFeaturePool.

Definition at line 130 of file qgsvectordataproviderfeaturepool.cpp.


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