mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
Vector data provider now has getFeatures() method to access features. select(), nextFeature(), featureAtId(), rewind() were removed resp. moved to provider's feature iterator implementations. Providers that currently do not implement the new API were disabled.
48 lines
1005 B
Plaintext
48 lines
1005 B
Plaintext
|
|
|
|
class QgsFeatureIterator
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsfeatureiterator.h>
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
QgsFeatureIterator* __iter__();
|
|
%MethodCode
|
|
sipRes = sipCpp;
|
|
%End
|
|
|
|
SIP_PYOBJECT __next__();
|
|
%MethodCode
|
|
QgsFeature* f = new QgsFeature;
|
|
if (sipCpp->nextFeature(*f))
|
|
sipRes = sipConvertFromInstance(f, sipClass_QgsFeature, Py_None);
|
|
else
|
|
{
|
|
delete f;
|
|
PyErr_SetString(PyExc_StopIteration,"");
|
|
}
|
|
%End
|
|
|
|
|
|
//! construct invalid iterator
|
|
QgsFeatureIterator();
|
|
//! construct a valid iterator
|
|
//QgsFeatureIterator(QgsAbstractFeatureIterator* iter);
|
|
//! copy constructor copies the iterator, increases ref.count
|
|
QgsFeatureIterator(const QgsFeatureIterator& fi);
|
|
//! destructor deletes the iterator if it has no more references
|
|
~QgsFeatureIterator();
|
|
|
|
//QgsFeatureIterator& operator=(const QgsFeatureIterator& other);
|
|
|
|
bool nextFeature(QgsFeature& f);
|
|
bool rewind();
|
|
bool close();
|
|
|
|
//! find out whether the iterator is still valid or closed already
|
|
bool isClosed();
|
|
};
|