QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsproxyfeaturesink.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsproxyfeaturesink.cpp
3
----------------------
4
begin : April 2020
5
copyright : (C) 2020 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
#include "
qgsproxyfeaturesink.h
"
19
20
QgsProxyFeatureSink::QgsProxyFeatureSink
(
QgsFeatureSink
*sink )
21
:
mSink
( sink )
22
{}
23
24
bool
QgsProxyFeatureSink::addFeature
(
QgsFeature
&feature,
Flags
flags )
25
{
26
if
( !
mSink
)
27
return
false
;
28
29
return
mSink
->addFeature( feature, flags );
30
}
31
32
bool
QgsProxyFeatureSink::addFeatures
(
QgsFeatureList
&features,
Flags
flags )
33
{
34
if
( !
mSink
)
35
return
false
;
36
37
return
mSink
->addFeatures( features, flags );
38
}
39
40
bool
QgsProxyFeatureSink::addFeatures
(
QgsFeatureIterator
&iterator,
Flags
flags )
41
{
42
if
( !
mSink
)
43
return
false
;
44
45
return
mSink
->addFeatures( iterator, flags );
46
}
47
48
QString
QgsProxyFeatureSink::lastError
()
const
49
{
50
return
mSink
?
mSink
->lastError() : QString();
51
}
52
53
bool
QgsProxyFeatureSink::flushBuffer
()
54
{
55
if
( !
mSink
)
56
return
false
;
57
58
return
mSink
->flushBuffer();
59
}
60
61
void
QgsProxyFeatureSink::finalize
()
62
{
63
if
(
mSink
)
64
{
65
mSink
->finalize();
66
}
67
}
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::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
QgsProxyFeatureSink::addFeature
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
Adds a single feature to the sink.
Definition
qgsproxyfeaturesink.cpp:24
QgsProxyFeatureSink::flushBuffer
bool flushBuffer() override
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to...
Definition
qgsproxyfeaturesink.cpp:53
QgsProxyFeatureSink::mSink
QgsFeatureSink * mSink
Underlying destination sink.
Definition
qgsproxyfeaturesink.h:58
QgsProxyFeatureSink::lastError
QString lastError() const override
Returns the most recent error encountered by the sink, e.g.
Definition
qgsproxyfeaturesink.cpp:48
QgsProxyFeatureSink::addFeatures
bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
Adds a list of features to the sink.
Definition
qgsproxyfeaturesink.cpp:32
QgsProxyFeatureSink::finalize
void finalize() override
Finalizes the sink, flushing any buffered features to the destination.
Definition
qgsproxyfeaturesink.cpp:61
QgsProxyFeatureSink::QgsProxyFeatureSink
QgsProxyFeatureSink(QgsFeatureSink *sink)
Constructs a new QgsProxyFeatureSink which forwards features onto a destination sink.
Definition
qgsproxyfeaturesink.cpp:20
QgsFeatureList
QList< QgsFeature > QgsFeatureList
Definition
qgsfeature.h:1289
qgsproxyfeaturesink.h
Generated on
for QGIS API Documentation by
1.17.0