QGIS API Documentation
3.41.0-Master (af5edcb665c)
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
:
35
41
enum
SinkFlag
SIP_ENUM_BASETYPE
( IntFlag )
42
{
43
54
RegeneratePrimaryKey = 1 << 1,
55
};
56
Q_DECLARE_FLAGS(
SinkFlags
,
SinkFlag
)
57
58
59
enum
Flag
SIP_ENUM_BASETYPE
( IntFlag )
60
{
61
69
FastInsert = 1 << 1,
70
77
RollBackOnErrors = 1 << 2,
78
};
79
Q_DECLARE_FLAGS(
Flags
,
Flag
)
80
81
virtual ~
QgsFeatureSink
() = default;
82
88
virtual
void
finalize();
89
95
virtual
bool
addFeature(
QgsFeature
&feature,
QgsFeatureSink
::
Flags
flags =
QgsFeatureSink
::
Flags
() );
96
102
virtual
bool
addFeatures(
QgsFeatureList
&features,
QgsFeatureSink
::
Flags
flags =
QgsFeatureSink
::
Flags
() ) = 0;
103
108
virtual
bool
addFeatures(
QgsFeatureIterator
&iterator,
QgsFeatureSink
::
Flags
flags =
QgsFeatureSink
::
Flags
() );
109
114
virtual
bool
flushBuffer() {
return
true
; }
115
121
virtual
QString
lastError
()
const
{
return
QString(); }
122
};
123
124
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QgsFeatureSink::Flags
)
125
126
Q_DECLARE_METATYPE
(
QgsFeatureSink
* )
127
128
#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:33
QgsFeatureSink::SinkFlags
QFlags< SinkFlag > SinkFlags
Definition
qgsfeaturesink.h:56
QgsFeatureSink::Flag
Flag
Flags controlling how features are added to a sink.
Definition
qgsfeaturesink.h:60
QgsFeatureSink::SinkFlag
SinkFlag
Flags that can be set on a QgsFeatureSink.
Definition
qgsfeaturesink.h:42
QgsFeatureSink::lastError
virtual QString lastError() const
Returns the most recent error encountered by the sink, e.g.
Definition
qgsfeaturesink.h:121
QgsFeatureSink::Flags
QFlags< Flag > Flags
Definition
qgsfeaturesink.h:79
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:58
qgis_sip.h
SIP_ENUM_BASETYPE
#define SIP_ENUM_BASETYPE(type)
Definition
qgis_sip.h:278
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
qgsfeature.h
QgsFeatureList
QList< QgsFeature > QgsFeatureList
Definition
qgsfeature.h:1264
qgsfeatureiterator.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)
Generated on Thu Dec 26 2024 02:19:01 for QGIS API Documentation by
1.9.8