QGIS API Documentation
2.0.1-Dufour
|
#include <qgsvectorlayerfeatureiterator.h>
Classes | |
struct | FetchJoinInfo |
Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes(). More... |
Public Member Functions | |
QgsVectorLayerFeatureIterator (QgsVectorLayer *layer, const QgsFeatureRequest &request) | |
~QgsVectorLayerFeatureIterator () | |
virtual bool | nextFeature (QgsFeature &feature) |
fetch next feature, return true on success | |
virtual bool | rewind () |
reset the iterator to the starting position | |
virtual bool | close () |
end of iterating: free the resources / lock | |
Public Member Functions inherited from QgsAbstractFeatureIterator | |
QgsAbstractFeatureIterator (const QgsFeatureRequest &request) | |
base class constructor - stores the iteration parameters | |
virtual | ~QgsAbstractFeatureIterator () |
destructor makes sure that the iterator is closed properly |
Protected Member Functions | |
void | rewindEditBuffer () |
void | prepareJoins () |
bool | fetchNextAddedFeature (QgsFeature &f) |
bool | fetchNextChangedGeomFeature (QgsFeature &f) |
void | useAddedFeature (const QgsFeature &src, QgsFeature &f) |
void | useChangedAttributeFeature (QgsFeatureId fid, const QgsGeometry &geom, QgsFeature &f) |
bool | nextFeatureFid (QgsFeature &f) |
void | addJoinedAttributes (QgsFeature &f) |
void | updateChangedAttributes (QgsFeature &f) |
Update feature with uncommited attribute updates. | |
void | updateFeatureGeometry (QgsFeature &f) |
Update feature with uncommited geometry updates. | |
Protected Member Functions inherited from QgsAbstractFeatureIterator | |
void | ref () |
void | deref () |
Protected Attributes | |
QgsVectorLayer * | L |
QgsFeatureRequest | mProviderRequest |
QgsFeatureIterator | mProviderIterator |
QSet< QgsFeatureId > | mFetchConsidered |
QgsGeometryMap::ConstIterator | mFetchChangedGeomIt |
QgsFeatureMap::ConstIterator | mFetchAddedFeaturesIt |
bool | mFetchedFid |
QgsFeatureMap | mAddedFeatures |
QgsGeometryMap | mChangedGeometries |
QgsFeatureIds | mDeletedFeatureIds |
QList< QgsField > | mAddedAttributes |
QgsChangedAttributesMap | mChangedAttributeValues |
QgsAttributeList | mDeletedAttributeIds |
QMap< QgsVectorLayer *, FetchJoinInfo > | mFetchJoinInfo |
Informations about joins used in the current select() statement. | |
Protected Attributes inherited from QgsAbstractFeatureIterator | |
QgsFeatureRequest | mRequest |
bool | mClosed |
int | refs |
Definition at line 28 of file qgsvectorlayerfeatureiterator.h.
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator | ( | QgsVectorLayer * | layer, |
const QgsFeatureRequest & | request | ||
) |
Definition at line 23 of file qgsvectorlayerfeatureiterator.cpp.
References QgsVectorLayerEditBuffer::addedAttributes(), QgsVectorLayerEditBuffer::addedFeatures(), QgsVectorLayerEditBuffer::changedAttributeValues(), QgsVectorLayerEditBuffer::changedGeometries(), QgsVectorLayerJoinBuffer::containsJoins(), QgsFields::count(), QgsVectorLayer::dataProvider(), QgsVectorLayerEditBuffer::deletedAttributeIds(), QgsVectorLayerEditBuffer::deletedFeatureIds(), QgsVectorLayer::editBuffer(), QgsFields::fieldOrigin(), QgsFields::fieldOriginIndex(), QgsFeatureRequest::FilterFid, QgsFeatureRequest::filterType(), QgsFeatureRequest::flags(), QgsVectorDataProvider::getFeatures(), L, mAddedAttributes, mAddedFeatures, mChangedAttributeValues, mChangedGeometries, mDeletedAttributeIds, mDeletedFeatureIds, mFetchedFid, QgsVectorLayer::mJoinBuffer, mProviderIterator, mProviderRequest, QgsAbstractFeatureIterator::mRequest, QgsFields::OriginProvider, QgsVectorLayer::pendingFields(), prepareJoins(), rewindEditBuffer(), QgsFeatureRequest::setSubsetOfAttributes(), QgsFeatureRequest::SubsetOfAttributes, and QgsFeatureRequest::subsetOfAttributes().
QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator | ( | ) |
Definition at line 75 of file qgsvectorlayerfeatureiterator.cpp.
References close().
|
protected |
Definition at line 347 of file qgsvectorlayerfeatureiterator.cpp.
References QgsVectorLayerFeatureIterator::FetchJoinInfo::addJoinedAttributesCached(), QgsVectorLayerFeatureIterator::FetchJoinInfo::addJoinedAttributesDirect(), QgsFeature::attribute(), QgsFeature::attributes(), QgsVectorJoinInfo::cachedAttributes, QgsFields::count(), QgsVectorLayerFeatureIterator::FetchJoinInfo::joinInfo, L, mFetchJoinInfo, QgsVectorLayer::pendingFields(), and QgsVectorLayerFeatureIterator::FetchJoinInfo::targetField.
Referenced by nextFeature(), nextFeatureFid(), useAddedFeature(), and useChangedAttributeFeature().
|
virtual |
end of iterating: free the resources / lock
Implements QgsAbstractFeatureIterator.
Definition at line 157 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFeatureIterator::close(), QgsAbstractFeatureIterator::mClosed, and mProviderIterator.
Referenced by nextFeature(), and ~QgsVectorLayerFeatureIterator().
|
protected |
Definition at line 171 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFeatureRequest::FilterRect, QgsFeatureRequest::filterRect(), QgsFeatureRequest::filterType(), mAddedFeatures, mFetchAddedFeaturesIt, mFetchConsidered, QgsAbstractFeatureIterator::mRequest, and useAddedFeature().
Referenced by nextFeature().
|
protected |
Definition at line 215 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFeatureRequest::filterRect(), mChangedGeometries, mFetchChangedGeomIt, mFetchConsidered, QgsAbstractFeatureIterator::mRequest, and useChangedAttributeFeature().
Referenced by nextFeature().
|
virtual |
fetch next feature, return true on success
Implements QgsAbstractFeatureIterator.
Definition at line 82 of file qgsvectorlayerfeatureiterator.cpp.
References addJoinedAttributes(), close(), fetchNextAddedFeature(), fetchNextChangedGeomFeature(), QgsFeatureRequest::FilterFid, QgsFeatureRequest::FilterRect, QgsFeatureRequest::filterType(), QgsFeatureRequest::flags(), QgsFeature::id(), L, QgsAbstractFeatureIterator::mClosed, mFetchConsidered, mFetchedFid, mFetchJoinInfo, mProviderIterator, QgsAbstractFeatureIterator::mRequest, QgsVectorLayer::mUpdatedFields, QgsFeatureIterator::nextFeature(), nextFeatureFid(), QgsFeatureRequest::NoGeometry, QgsFeature::setFields(), QgsFeature::setValid(), updateChangedAttributes(), and updateFeatureGeometry().
|
protected |
Definition at line 468 of file qgsvectorlayerfeatureiterator.cpp.
References addJoinedAttributes(), QgsVectorLayer::dataProvider(), QgsFeatureRequest::filterFid(), QgsFeatureRequest::flags(), QgsVectorDataProvider::getFeatures(), L, mAddedFeatures, mChangedGeometries, mDeletedFeatureIds, mFetchJoinInfo, mProviderRequest, QgsAbstractFeatureIterator::mRequest, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, updateChangedAttributes(), useAddedFeature(), and useChangedAttributeFeature().
Referenced by nextFeature().
|
protected |
Definition at line 288 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFields::fieldOrigin(), QgsFeatureRequest::flags(), QgsFields::indexFromName(), QgsVectorLayerFeatureIterator::FetchJoinInfo::indexOffset, QgsMapLayerRegistry::instance(), QgsVectorLayerFeatureIterator::FetchJoinInfo::joinField, QgsVectorJoinInfo::joinFieldIndex, QgsVectorJoinInfo::joinFieldName, QgsVectorLayerJoinBuffer::joinForFieldIndex(), QgsVectorLayerFeatureIterator::FetchJoinInfo::joinInfo, QgsVectorLayerFeatureIterator::FetchJoinInfo::joinLayer, QgsVectorJoinInfo::joinLayerId, L, QgsMapLayerRegistry::mapLayer(), mFetchJoinInfo, QgsVectorLayer::mJoinBuffer, QgsAbstractFeatureIterator::mRequest, QgsFields::OriginJoin, QgsVectorLayer::pendingAllAttributesList(), QgsVectorLayer::pendingFields(), QgsFeatureRequest::setSubsetOfAttributes(), QgsFeatureRequest::SubsetOfAttributes, QgsFeatureRequest::subsetOfAttributes(), QgsVectorLayerFeatureIterator::FetchJoinInfo::targetField, QgsVectorJoinInfo::targetFieldIndex, and QgsVectorJoinInfo::targetFieldName.
Referenced by QgsVectorLayerFeatureIterator().
|
virtual |
reset the iterator to the starting position
Implements QgsAbstractFeatureIterator.
Definition at line 139 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFeatureRequest::FilterFid, QgsFeatureRequest::filterType(), QgsAbstractFeatureIterator::mClosed, mFetchedFid, mProviderIterator, QgsAbstractFeatureIterator::mRequest, QgsFeatureIterator::rewind(), and rewindEditBuffer().
|
protected |
Definition at line 278 of file qgsvectorlayerfeatureiterator.cpp.
References mAddedFeatures, mChangedGeometries, mDeletedFeatureIds, mFetchAddedFeaturesIt, mFetchChangedGeomIt, and mFetchConsidered.
Referenced by QgsVectorLayerFeatureIterator(), and rewind().
|
protected |
Update feature with uncommited attribute updates.
Definition at line 508 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFeature::attributes(), QgsFeature::id(), mAddedAttributes, mChangedAttributeValues, and mDeletedAttributeIds.
Referenced by nextFeature(), nextFeatureFid(), and useChangedAttributeFeature().
|
protected |
Update feature with uncommited geometry updates.
Definition at line 530 of file qgsvectorlayerfeatureiterator.cpp.
References QgsFeature::id(), mChangedGeometries, and QgsFeature::setGeometry().
Referenced by nextFeature().
|
protected |
Definition at line 196 of file qgsvectorlayerfeatureiterator.cpp.
References addJoinedAttributes(), QgsFeature::attributes(), QgsFeatureRequest::flags(), QgsFeature::geometry(), QgsFeature::id(), L, mFetchJoinInfo, QgsAbstractFeatureIterator::mRequest, QgsVectorLayer::mUpdatedFields, QgsFeatureRequest::NoGeometry, QgsFeature::setAttributes(), QgsFeature::setFeatureId(), QgsFeature::setFields(), QgsFeature::setGeometry(), and QgsFeature::setValid().
Referenced by fetchNextAddedFeature(), and nextFeatureFid().
|
protected |
Definition at line 243 of file qgsvectorlayerfeatureiterator.cpp.
References addJoinedAttributes(), QgsFeature::attributes(), QgsVectorLayer::dataProvider(), QgsFeatureRequest::flags(), QgsVectorDataProvider::getFeatures(), L, mFetchJoinInfo, mProviderRequest, QgsAbstractFeatureIterator::mRequest, QgsVectorLayer::mUpdatedFields, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, QgsFeature::setAttributes(), QgsFeature::setFeatureId(), QgsFeature::setFields(), QgsFeatureRequest::setFilterFid(), QgsFeatureRequest::setFlags(), QgsFeature::setGeometry(), QgsFeatureRequest::setSubsetOfAttributes(), QgsFeature::setValid(), QgsFeatureRequest::SubsetOfAttributes, QgsFeatureRequest::subsetOfAttributes(), and updateChangedAttributes().
Referenced by fetchNextChangedGeomFeature(), and nextFeatureFid().
|
protected |
Definition at line 45 of file qgsvectorlayerfeatureiterator.h.
Referenced by addJoinedAttributes(), nextFeature(), nextFeatureFid(), prepareJoins(), QgsVectorLayerFeatureIterator(), useAddedFeature(), and useChangedAttributeFeature().
|
protected |
Definition at line 103 of file qgsvectorlayerfeatureiterator.h.
Referenced by QgsVectorLayerFeatureIterator(), and updateChangedAttributes().
|
protected |
Definition at line 100 of file qgsvectorlayerfeatureiterator.h.
Referenced by fetchNextAddedFeature(), nextFeatureFid(), QgsVectorLayerFeatureIterator(), and rewindEditBuffer().
|
protected |
Definition at line 104 of file qgsvectorlayerfeatureiterator.h.
Referenced by QgsVectorLayerFeatureIterator(), and updateChangedAttributes().
|
protected |
Definition at line 101 of file qgsvectorlayerfeatureiterator.h.
Referenced by fetchNextChangedGeomFeature(), nextFeatureFid(), QgsVectorLayerFeatureIterator(), rewindEditBuffer(), and updateFeatureGeometry().
|
protected |
Definition at line 105 of file qgsvectorlayerfeatureiterator.h.
Referenced by QgsVectorLayerFeatureIterator(), and updateChangedAttributes().
|
protected |
Definition at line 102 of file qgsvectorlayerfeatureiterator.h.
Referenced by nextFeatureFid(), QgsVectorLayerFeatureIterator(), and rewindEditBuffer().
|
protected |
Definition at line 62 of file qgsvectorlayerfeatureiterator.h.
Referenced by fetchNextAddedFeature(), and rewindEditBuffer().
|
protected |
Definition at line 61 of file qgsvectorlayerfeatureiterator.h.
Referenced by fetchNextChangedGeomFeature(), and rewindEditBuffer().
|
protected |
Definition at line 60 of file qgsvectorlayerfeatureiterator.h.
Referenced by fetchNextAddedFeature(), fetchNextChangedGeomFeature(), nextFeature(), and rewindEditBuffer().
|
protected |
Definition at line 64 of file qgsvectorlayerfeatureiterator.h.
Referenced by nextFeature(), QgsVectorLayerFeatureIterator(), and rewind().
|
protected |
Informations about joins used in the current select() statement.
Allows faster mapping of attribute ids compared to mVectorJoins
Definition at line 109 of file qgsvectorlayerfeatureiterator.h.
Referenced by addJoinedAttributes(), nextFeature(), nextFeatureFid(), prepareJoins(), useAddedFeature(), and useChangedAttributeFeature().
|
protected |
Definition at line 48 of file qgsvectorlayerfeatureiterator.h.
Referenced by close(), nextFeature(), QgsVectorLayerFeatureIterator(), and rewind().
|
protected |
Definition at line 47 of file qgsvectorlayerfeatureiterator.h.
Referenced by nextFeatureFid(), QgsVectorLayerFeatureIterator(), and useChangedAttributeFeature().