12 Commits

Author SHA1 Message Date
Nyall Dawson
bf3d55c9e5 Move flushBuffer method up to QgsFeatureSink
Allows calling flushBuffer on QgsFeatureSink objects, ensuring
that any internal buffer the sink may have is flushed
2017-06-30 09:20:56 +10:00
Nyall Dawson
fc339f9ac5 Add a flag argument to QgsFeatureSink::addFeatures
Flags can be used to control how features are added to the sink.

For now, there's only a single flag available - FastInsert.
When FastInsert is set, faster inserts will be use at the cost
of updating the passed features to reflect changes made at the
provider.

This includes skipping the update of the passed feature IDs
to match the resulting feature IDs for the feature within
the data provider.

Individual sink subclasses may or may not choose to respect
this flag, depending on whether or not skipping this update
represents a significant speed boost for the operation.

QgsVectorLayer always ignores the flag - feature ids are
required for the featureAdded signal to be correctly emitted,
and it's expected that performance critical applications will
add features directly to a data provider instead of
via QgsVectorLayer's edit buffer.
2017-06-15 17:04:27 +10:00
Nyall Dawson
e40cb0716c Move QgsProxyFeatureSink methods to header
To allow better compiler optimisation
2017-05-03 19:51:32 +10:00
Nyall Dawson
96ad51138b Add method to retrieve sink 2017-05-03 19:50:38 +10:00
Nyall Dawson
fde71cf9b2 Add QgsProxyFeatureSink
A simple feature sink which proxies feature addition on to another feature sink.

This class is designed to allow factory methods which always return new QgsFeatureSink
objects. Since it is not always possible to create an entirely new QgsFeatureSink
(e.g. if the feature sink is a layer or a layer's data provider), a new
QgsProxyFeatureSink can instead be returned which forwards features on to
the destination sink. The proxy sink can be safely deleted without affecting
the destination sink.
2017-05-03 16:56:37 +10:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Nyall Dawson
3dfc4cf6fd Provide a base class version of QgsFeatureSink::addFeature
Means that subclasses are only required to implement addFeatures
2017-04-26 11:58:19 +10:00
Nyall Dawson
dd7be73fa4 Add a method to QgsFeatureSink to add all features from an iterator 2017-04-26 11:43:47 +10:00
Nyall Dawson
1280779617 Don't force use of In,Out in QgsFeatureSink methods 2017-04-26 11:32:34 +10:00
Nyall Dawson
8d0a9d6bce Add In,Out annotations to QgsFeatureSink methods 2017-04-26 10:43:44 +10:00
Nyall Dawson
7ae71ded57 QgsVectorDataProvider is a QgsFeatureSink 2017-04-26 10:43:07 +10:00
Nyall Dawson
363336394e Add a QgsFeatureSink interface for classes which accept adding features 2017-04-26 10:39:57 +10:00