QGIS API Documentation
2.8.2-Wien
|
Internal feature iterator to be implemented within data providers. More...
#include <qgsfeatureiterator.h>
Public Member Functions | |
QgsAbstractFeatureIterator (const QgsFeatureRequest &request) | |
base class constructor - stores the iteration parameters | |
virtual | ~QgsAbstractFeatureIterator () |
destructor makes sure that the iterator is closed properly | |
virtual bool | close ()=0 |
end of iterating: free the resources / lock | |
virtual bool | nextFeature (QgsFeature &f) |
fetch next feature, return true on success | |
virtual bool | rewind ()=0 |
reset the iterator to the starting position |
Protected Member Functions | |
void | deref () |
remove reference, delete if refs == 0 | |
virtual bool | fetchFeature (QgsFeature &f)=0 |
If you write a feature iterator for your provider, this is the method you need to implement!! | |
virtual bool | nextFeatureFilterExpression (QgsFeature &f) |
By default, the iterator will fetch all features and check if the feature matches the expression. | |
virtual bool | nextFeatureFilterFids (QgsFeature &f) |
By default, the iterator will fetch all features and check if the id is in the request. | |
virtual bool | prepareSimplification (const QgsSimplifyMethod &simplifyMethod) |
Setup the simplification of geometries to fetch using the specified simplify method. | |
void | ref () |
add reference |
Protected Attributes | |
bool | mClosed |
Set to true, as soon as the iterator is closed. | |
QgsFeatureRequest | mRequest |
A copy of the feature request. | |
int | refs |
reference counting (to allow seamless copying of QgsFeatureIterator instances) |
Friends | |
class | QgsFeatureIterator |
Internal feature iterator to be implemented within data providers.
Definition at line 26 of file qgsfeatureiterator.h.
QgsAbstractFeatureIterator::QgsAbstractFeatureIterator | ( | const QgsFeatureRequest & | request | ) |
base class constructor - stores the iteration parameters
Definition at line 21 of file qgsfeatureiterator.cpp.
|
virtual |
destructor makes sure that the iterator is closed properly
Definition at line 30 of file qgsfeatureiterator.cpp.
|
pure virtual |
end of iterating: free the resources / lock
Implemented in QgsCachedFeatureWriterIterator, QgsVectorLayerFeatureIterator, and QgsCachedFeatureIterator.
|
protected |
remove reference, delete if refs == 0
Definition at line 99 of file qgsfeatureiterator.cpp.
|
protectedpure virtual |
If you write a feature iterator for your provider, this is the method you need to implement!!
f | The feature to write to |
Implemented in QgsCachedFeatureWriterIterator, QgsVectorLayerFeatureIterator, and QgsCachedFeatureIterator.
|
virtual |
fetch next feature, return true on success
Definition at line 36 of file qgsfeatureiterator.cpp.
|
protectedvirtual |
By default, the iterator will fetch all features and check if the feature matches the expression.
If you have a more sophisticated metodology (SQL request for the features...) and you check for the expression in your fetchFeature method, you can just redirect this call to fetchFeature so the default check will be omitted.
f | The feature to write to |
Reimplemented in QgsVectorLayerFeatureIterator.
Definition at line 65 of file qgsfeatureiterator.cpp.
|
protectedvirtual |
By default, the iterator will fetch all features and check if the id is in the request.
If you have a more sophisticated metodology (SQL request for the features...) and you are sure, that any feature you return from fetchFeature will match if the request was FilterFids you can just redirect this call to fetchFeature so the default check will be omitted.
f | The feature to write to |
Reimplemented in QgsCachedFeatureIterator.
Definition at line 75 of file qgsfeatureiterator.cpp.
|
protectedvirtual |
Setup the simplification of geometries to fetch using the specified simplify method.
Reimplemented in QgsVectorLayerFeatureIterator.
Definition at line 106 of file qgsfeatureiterator.cpp.
|
protected |
add reference
Definition at line 85 of file qgsfeatureiterator.cpp.
|
pure virtual |
reset the iterator to the starting position
Implemented in QgsCachedFeatureWriterIterator, QgsVectorLayerFeatureIterator, and QgsCachedFeatureIterator.
|
friend |
Definition at line 88 of file qgsfeatureiterator.h.
|
protected |
Set to true, as soon as the iterator is closed.
Definition at line 82 of file qgsfeatureiterator.h.
|
protected |
A copy of the feature request.
Definition at line 79 of file qgsfeatureiterator.h.
|
protected |
reference counting (to allow seamless copying of QgsFeatureIterator instances)
Definition at line 85 of file qgsfeatureiterator.h.