mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Provide a base class version of QgsFeatureSink::addFeature
Means that subclasses are only required to implement addFeatures
This commit is contained in:
parent
dd7be73fa4
commit
3dfc4cf6fd
@ -24,7 +24,7 @@ class QgsFeatureSink
|
||||
|
||||
virtual ~QgsFeatureSink();
|
||||
|
||||
virtual bool addFeature( QgsFeature &feature ) = 0;
|
||||
virtual bool addFeature( QgsFeature &feature );
|
||||
%Docstring
|
||||
Adds a single ``feature`` to the sink.
|
||||
\see addFeatures()
|
||||
|
@ -197,7 +197,6 @@ class QgsVectorDataProvider : QgsDataProvider, QgsFeatureSink
|
||||
*/
|
||||
virtual void enumValues( int index, QStringList& enumList /Out/ ) const;
|
||||
|
||||
virtual bool addFeature( QgsFeature &feature /In,Out/ );
|
||||
virtual bool addFeatures( QList<QgsFeature> &flist /In,Out/ );
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,17 @@
|
||||
|
||||
#include "qgsfeaturestore.h"
|
||||
|
||||
bool QgsFeatureSink::addFeature( QgsFeature &feature )
|
||||
{
|
||||
QgsFeatureList features;
|
||||
features << feature;
|
||||
bool result = addFeatures( features );
|
||||
|
||||
// need to update the passed feature reference to the updated copy from the features list
|
||||
feature = features.at( 0 );
|
||||
return result;
|
||||
}
|
||||
|
||||
bool QgsFeatureSink::addFeatures( QgsFeatureIterator &iterator )
|
||||
{
|
||||
QgsFeature f;
|
||||
|
@ -41,7 +41,7 @@ class CORE_EXPORT QgsFeatureSink
|
||||
* \see addFeatures()
|
||||
* \returns true in case of success and false in case of failure
|
||||
*/
|
||||
virtual bool addFeature( QgsFeature &feature ) = 0;
|
||||
virtual bool addFeature( QgsFeature &feature );
|
||||
|
||||
/**
|
||||
* Adds a list of \a features to the sink.
|
||||
|
@ -495,11 +495,6 @@ QVariant QgsVectorDataProvider::aggregate( QgsAggregateCalculator::Aggregate agg
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool QgsVectorDataProvider::addFeature( QgsFeature &feature )
|
||||
{
|
||||
return addFeatures( QgsFeatureList() << feature );
|
||||
}
|
||||
|
||||
void QgsVectorDataProvider::clearMinMaxCache()
|
||||
{
|
||||
mCacheMinMaxDirty = true;
|
||||
|
@ -248,7 +248,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
|
||||
*/
|
||||
virtual void enumValues( int index, QStringList &enumList ) const { Q_UNUSED( index ); enumList.clear(); }
|
||||
|
||||
virtual bool addFeature( QgsFeature &feature ) override;
|
||||
virtual bool addFeatures( QgsFeatureList &flist ) override;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user