QGIS API Documentation
3.34.0-Prizren (ffbdd678812)
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
33
class
CORE_EXPORT
QgsFeatureSink
34
{
35
public
:
36
42
enum
SinkFlag
43
{
44
55
RegeneratePrimaryKey = 1 << 1,
56
};
57
Q_DECLARE_FLAGS( SinkFlags, SinkFlag )
58
59
60
enum
Flag
61
{
62
70
FastInsert = 1 << 1,
71
78
RollBackOnErrors = 1 << 2,
79
};
80
Q_DECLARE_FLAGS( Flags, Flag )
81
82
virtual ~
QgsFeatureSink
() = default;
83
89
virtual
bool
addFeature(
QgsFeature
&feature,
QgsFeatureSink
::Flags flags =
QgsFeatureSink
::Flags() );
90
96
virtual
bool
addFeatures(
QgsFeatureList
&features,
QgsFeatureSink
::Flags flags =
QgsFeatureSink
::Flags() ) = 0;
97
102
virtual
bool
addFeatures(
QgsFeatureIterator
&iterator,
QgsFeatureSink
::Flags flags =
QgsFeatureSink
::Flags() );
103
108
virtual
bool
flushBuffer() {
return
true
; }
109
115
virtual
QString
lastError
()
const
{
return
QString(); }
116
};
117
118
Q_DECLARE_OPERATORS_FOR_FLAGS
( QgsFeatureSink::Flags )
119
120
Q_DECLARE_METATYPE
(
QgsFeatureSink
* )
121
122
#endif
// QGSFEATURESINK_H
QgsFeatureIterator
Wrapper for iterator of features from vector data provider or vector layer.
Definition
qgsfeatureiterator.h:290
QgsFeatureSink
An interface for objects which accept features via addFeature(s) methods.
Definition
qgsfeaturesink.h:34
QgsFeatureSink::Flag
Flag
Flags controlling how features are added to a sink.
Definition
qgsfeaturesink.h:61
QgsFeatureSink::SinkFlag
SinkFlag
Flags that can be set on a QgsFeatureSink.
Definition
qgsfeaturesink.h:43
QgsFeatureSink::lastError
virtual QString lastError() const
Returns the most recent error encountered by the sink, e.g.
Definition
qgsfeaturesink.h:115
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:56
qgis_sip.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
qgsfeature.h
QgsFeatureList
QList< QgsFeature > QgsFeatureList
Definition
qgsfeature.h:920
qgsfeatureiterator.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)
Generated on Mon Oct 30 2023 18:42:25 for QGIS API Documentation by
1.9.8