|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgsfeatureiterator.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
1 | 11 | class QgsAbstractFeatureIterator
|
2 | 12 | {
|
| 13 | +%Docstring |
| 14 | + Internal feature iterator to be implemented within data providers |
| 15 | +%End |
| 16 | + |
3 | 17 | %TypeHeaderCode
|
4 |
| -#include <qgsfeatureiterator.h> |
| 18 | +#include "qgsfeatureiterator.h" |
5 | 19 | %End
|
6 | 20 | public:
|
7 | 21 |
|
8 |
| - //! Status of expression compilation for filter expression requests |
9 | 22 | enum CompileStatus
|
10 | 23 | {
|
11 |
| - NoCompilation, /*!< Expression could not be compiled or not attempt was made to compile expression */ |
12 |
| - PartiallyCompiled, /*!< Expression was partially compiled, but extra checks need to be applied to features*/ |
13 |
| - Compiled, /*!< Expression was fully compiled and delegated to data provider source*/ |
| 24 | + NoCompilation, |
| 25 | + PartiallyCompiled, |
| 26 | + Compiled, |
14 | 27 | };
|
15 | 28 |
|
16 |
| - //! base class constructor - stores the iteration parameters |
17 | 29 | QgsAbstractFeatureIterator( const QgsFeatureRequest &request );
|
| 30 | +%Docstring |
| 31 | +base class constructor - stores the iteration parameters |
| 32 | +%End |
18 | 33 |
|
19 |
| - //! destructor makes sure that the iterator is closed properly |
20 | 34 | virtual ~QgsAbstractFeatureIterator();
|
| 35 | +%Docstring |
| 36 | +destructor makes sure that the iterator is closed properly |
| 37 | +%End |
21 | 38 |
|
22 |
| - //! fetch next feature, return true on success |
23 | 39 | virtual bool nextFeature( QgsFeature &f );
|
| 40 | +%Docstring |
| 41 | +fetch next feature, return true on success |
| 42 | + :rtype: bool |
| 43 | +%End |
24 | 44 |
|
25 |
| - //! reset the iterator to the starting position |
26 | 45 | virtual bool rewind() = 0;
|
27 |
| - //! end of iterating: free the resources / lock |
| 46 | +%Docstring |
| 47 | +reset the iterator to the starting position |
| 48 | + :rtype: bool |
| 49 | +%End |
28 | 50 | virtual bool close() = 0;
|
| 51 | +%Docstring |
| 52 | +end of iterating: free the resources / lock |
| 53 | + :rtype: bool |
| 54 | +%End |
| 55 | + |
29 | 56 |
|
30 |
| - /** Returns the status of expression compilation for filter expression requests. |
31 |
| - * @note added in QGIS 2.16 |
32 |
| - */ |
33 | 57 | CompileStatus compileStatus() const;
|
| 58 | +%Docstring |
| 59 | + Returns the status of expression compilation for filter expression requests. |
| 60 | +.. versionadded:: 2.16 |
| 61 | + :rtype: CompileStatus |
| 62 | +%End |
34 | 63 |
|
35 | 64 | protected:
|
36 |
| - /** |
37 |
| - * If you write a feature iterator for your provider, this is the method you |
38 |
| - * need to implement!! |
39 |
| - * |
40 |
| - * @param f The feature to write to |
41 |
| - * @return true if a feature was written to f |
42 |
| - */ |
| 65 | + |
43 | 66 | virtual bool fetchFeature( QgsFeature &f ) = 0;
|
| 67 | +%Docstring |
| 68 | + If you write a feature iterator for your provider, this is the method you |
| 69 | + need to implement!! |
| 70 | + |
| 71 | + \param f The feature to write to |
| 72 | + :return: true if a feature was written to f |
| 73 | + :rtype: bool |
| 74 | +%End |
44 | 75 |
|
45 |
| - /** |
46 |
| - * By default, the iterator will fetch all features and check if the feature |
47 |
| - * matches the expression. |
48 |
| - * If you have a more sophisticated metodology (SQL request for the features...) |
49 |
| - * and you check for the expression in your fetchFeature method, you can just |
50 |
| - * redirect this call to fetchFeature so the default check will be omitted. |
51 |
| - * |
52 |
| - * @param f The feature to write to |
53 |
| - * @return true if a feature was written to f |
54 |
| - */ |
55 | 76 | virtual bool nextFeatureFilterExpression( QgsFeature &f );
|
| 77 | +%Docstring |
| 78 | + By default, the iterator will fetch all features and check if the feature |
| 79 | + matches the expression. |
| 80 | + If you have a more sophisticated metodology (SQL request for the features...) |
| 81 | + and you check for the expression in your fetchFeature method, you can just |
| 82 | + redirect this call to fetchFeature so the default check will be omitted. |
| 83 | + |
| 84 | + \param f The feature to write to |
| 85 | + :return: true if a feature was written to f |
| 86 | + :rtype: bool |
| 87 | +%End |
56 | 88 |
|
57 |
| - /** |
58 |
| - * By default, the iterator will fetch all features and check if the id |
59 |
| - * is in the request. |
60 |
| - * If you have a more sophisticated metodology (SQL request for the features...) |
61 |
| - * and you are sure, that any feature you return from fetchFeature will match |
62 |
| - * if the request was FilterFids you can just redirect this call to fetchFeature |
63 |
| - * so the default check will be omitted. |
64 |
| - * |
65 |
| - * @param f The feature to write to |
66 |
| - * @return true if a feature was written to f |
67 |
| - */ |
68 | 89 | virtual bool nextFeatureFilterFids( QgsFeature &f );
|
| 90 | +%Docstring |
| 91 | + By default, the iterator will fetch all features and check if the id |
| 92 | + is in the request. |
| 93 | + If you have a more sophisticated metodology (SQL request for the features...) |
| 94 | + and you are sure, that any feature you return from fetchFeature will match |
| 95 | + if the request was FilterFids you can just redirect this call to fetchFeature |
| 96 | + so the default check will be omitted. |
| 97 | + |
| 98 | + \param f The feature to write to |
| 99 | + :return: true if a feature was written to f |
| 100 | + :rtype: bool |
| 101 | +%End |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + void ref(); |
| 107 | +%Docstring |
| 108 | +Add reference |
| 109 | +%End |
| 110 | + void deref(); |
| 111 | +%Docstring |
| 112 | +Remove reference, delete if refs == 0 |
| 113 | +%End |
| 114 | + |
69 | 115 |
|
70 |
| - void ref(); //!< add reference |
71 |
| - void deref(); //!< remove reference, delete if refs == 0 |
72 | 116 |
|
73 |
| - //! Setup the simplification of geometries to fetch using the specified simplify method |
74 | 117 | virtual bool prepareSimplification( const QgsSimplifyMethod &simplifyMethod );
|
| 118 | +%Docstring |
| 119 | +Setup the simplification of geometries to fetch using the specified simplify method |
| 120 | + :rtype: bool |
| 121 | +%End |
| 122 | + |
75 | 123 | };
|
76 | 124 |
|
77 | 125 |
|
78 | 126 | class QgsFeatureIterator
|
79 | 127 | {
|
80 |
| -%TypeHeaderCode |
81 |
| -#include <qgsfeatureiterator.h> |
| 128 | +%Docstring |
| 129 | + Wrapper for iterator of features from vector data provider or vector layer |
82 | 130 | %End
|
83 | 131 |
|
| 132 | +%TypeHeaderCode |
| 133 | +#include "qgsfeatureiterator.h" |
| 134 | +%End |
84 | 135 | public:
|
| 136 | + |
85 | 137 | QgsFeatureIterator *__iter__();
|
| 138 | +%Docstring |
| 139 | + :rtype: QgsFeatureIterator |
| 140 | +%End |
86 | 141 | %MethodCode
|
87 |
| - sipRes = sipCpp; |
| 142 | + sipRes = sipCpp; |
88 | 143 | %End
|
89 | 144 |
|
90 |
| - SIP_PYOBJECT __next__(); |
| 145 | + SIP_PYOBJECT __next__(); |
91 | 146 | %MethodCode
|
92 |
| - QgsFeature *f = new QgsFeature; |
93 |
| - if (sipCpp->nextFeature(*f)) |
94 |
| - sipRes = sipConvertFromType(f, sipType_QgsFeature, Py_None); |
95 |
| - else |
96 |
| - { |
97 |
| - delete f; |
98 |
| - PyErr_SetString(PyExc_StopIteration,""); |
99 |
| - } |
| 147 | + QgsFeature *f = new QgsFeature; |
| 148 | + if ( sipCpp->nextFeature( *f ) ) |
| 149 | + sipRes = sipConvertFromType( f, sipType_QgsFeature, Py_None ); |
| 150 | + else |
| 151 | + { |
| 152 | + delete f; |
| 153 | + PyErr_SetString( PyExc_StopIteration, "" ); |
| 154 | + } |
100 | 155 | %End
|
101 | 156 |
|
102 |
| - //! construct invalid iterator |
103 | 157 | QgsFeatureIterator();
|
104 |
| - //! construct a valid iterator |
105 |
| - // QgsFeatureIterator( QgsAbstractFeatureIterator *iter ); |
106 |
| - //! copy constructor copies the iterator, increases ref.count |
| 158 | +%Docstring |
| 159 | +construct invalid iterator |
| 160 | +%End |
107 | 161 | QgsFeatureIterator( const QgsFeatureIterator &fi );
|
108 |
| - //! destructor deletes the iterator if it has no more references |
| 162 | +%Docstring |
| 163 | +copy constructor copies the iterator, increases ref.count |
| 164 | +%End |
109 | 165 | ~QgsFeatureIterator();
|
| 166 | +%Docstring |
| 167 | +destructor deletes the iterator if it has no more references |
| 168 | +%End |
110 | 169 |
|
111 |
| - // QgsFeatureIterator &operator=(const QgsFeatureIterator &other); |
112 | 170 |
|
113 | 171 | bool nextFeature( QgsFeature &f );
|
| 172 | +%Docstring |
| 173 | + :rtype: bool |
| 174 | +%End |
114 | 175 | bool rewind();
|
| 176 | +%Docstring |
| 177 | + :rtype: bool |
| 178 | +%End |
115 | 179 | bool close();
|
| 180 | +%Docstring |
| 181 | + :rtype: bool |
| 182 | +%End |
116 | 183 |
|
117 |
| - //! find out whether the iterator is still valid or closed already |
118 | 184 | bool isClosed() const;
|
| 185 | +%Docstring |
| 186 | +find out whether the iterator is still valid or closed already |
| 187 | + :rtype: bool |
| 188 | +%End |
| 189 | + |
119 | 190 |
|
120 |
| - /** Returns the status of expression compilation for filter expression requests. |
121 |
| - * @note added in QGIS 2.16 |
122 |
| - */ |
123 | 191 | QgsAbstractFeatureIterator::CompileStatus compileStatus() const;
|
| 192 | +%Docstring |
| 193 | + Returns the status of expression compilation for filter expression requests. |
| 194 | +.. versionadded:: 2.16 |
| 195 | + :rtype: QgsAbstractFeatureIterator.CompileStatus |
| 196 | +%End |
| 197 | + |
124 | 198 |
|
125 | 199 | };
|
| 200 | + |
| 201 | + |
| 202 | +/************************************************************************ |
| 203 | + * This file has been generated automatically from * |
| 204 | + * * |
| 205 | + * src/core/qgsfeatureiterator.h * |
| 206 | + * * |
| 207 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 208 | + ************************************************************************/ |
0 commit comments