QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsfeaturesink.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfeaturesink.h
3
----------------
4
begin : April 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSFEATURESINK_H
19
#define QGSFEATURESINK_H
20
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
#include "
qgsfeature.h
"
24
#include "
qgsfeatureiterator.h
"
25
32
class
CORE_EXPORT
QgsFeatureSink
33
{
34
public
:
40
enum
SinkFlag
SIP_ENUM_BASETYPE
( IntFlag )
41
{
42
53
RegeneratePrimaryKey
= 1 << 1,
54
};
55
Q_DECLARE_FLAGS(
SinkFlags
,
SinkFlag
)
56
57
58
enum
Flag
SIP_ENUM_BASETYPE
( IntFlag )
59
{
60
68
FastInsert
= 1 << 1,
69
76
RollBackOnErrors
= 1 << 2,
77
};
78
Q_DECLARE_FLAGS(
Flags
,
Flag
)
79
80
virtual ~
QgsFeatureSink
() = default;
81
87
virtual
void
finalize
();
88
94
virtual
bool
addFeature
(
QgsFeature
&feature,
QgsFeatureSink
::
Flags
flags =
QgsFeatureSink
::
Flags
() );
95
101
virtual
bool
addFeatures
(
QgsFeatureList
&features,
QgsFeatureSink
::
Flags
flags =
QgsFeatureSink
::
Flags
() ) = 0;
102
107
virtual
bool
addFeatures
(
QgsFeatureIterator
&iterator,
QgsFeatureSink
::
Flags
flags =
QgsFeatureSink
::
Flags
() );
108
113
virtual
bool
flushBuffer
() {
return
true
; }
114
120
virtual
QString
lastError
()
const
{
return
QString(); }
121
};
122
123
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QgsFeatureSink::Flags
)
124
125
Q_DECLARE_METATYPE
(
QgsFeatureSink
* )
126
127
#endif
// QGSFEATURESINK_H
QgsFeatureIterator
Wrapper for iterator of features from vector data provider or vector layer.
Definition
qgsfeatureiterator.h:284
QgsFeatureSink
An interface for objects which accept features via addFeature(s) methods.
Definition
qgsfeaturesink.h:33
QgsFeatureSink::SinkFlags
QFlags< SinkFlag > SinkFlags
Definition
qgsfeaturesink.h:55
QgsFeatureSink::flushBuffer
virtual bool flushBuffer()
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
Definition
qgsfeaturesink.h:113
QgsFeatureSink::addFeature
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())
Adds a single feature to the sink.
Definition
qgsfeaturesink.cpp:25
QgsFeatureSink::Flag
Flag
Flags controlling how features are added to a sink.
Definition
qgsfeaturesink.h:59
QgsFeatureSink::RollBackOnErrors
@ RollBackOnErrors
Roll back the whole transaction if a single add feature operation fails.
Definition
qgsfeaturesink.h:76
QgsFeatureSink::FastInsert
@ FastInsert
Use faster inserts, at the cost of updating the passed features to reflect changes made at the provid...
Definition
qgsfeaturesink.h:68
QgsFeatureSink::SinkFlag
SinkFlag
Flags that can be set on a QgsFeatureSink.
Definition
qgsfeaturesink.h:41
QgsFeatureSink::RegeneratePrimaryKey
@ RegeneratePrimaryKey
This flag indicates, that a primary key field cannot be guaranteed to be unique and the sink should i...
Definition
qgsfeaturesink.h:53
QgsFeatureSink::lastError
virtual QString lastError() const
Returns the most recent error encountered by the sink, e.g.
Definition
qgsfeaturesink.h:120
QgsFeatureSink::addFeatures
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())=0
Adds a list of features to the sink.
QgsFeatureSink::finalize
virtual void finalize()
Finalizes the sink, flushing any buffered features to the destination.
Definition
qgsfeaturesink.cpp:20
QgsFeatureSink::Flags
QFlags< Flag > Flags
Definition
qgsfeaturesink.h:78
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
qgis_sip.h
SIP_ENUM_BASETYPE
#define SIP_ENUM_BASETYPE(type)
Definition
qgis_sip.h:277
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTimeZoneComboBox::StandardItems)
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
qgsfeature.h
QgsFeatureList
QList< QgsFeature > QgsFeatureList
Definition
qgsfeature.h:1289
qgsfeatureiterator.h
Generated on
for QGIS API Documentation by
1.17.0