QGIS API Documentation  2.14.11-Essen
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsVectorLayerFeatureIterator Class Reference

#include <qgsvectorlayerfeatureiterator.h>

Inheritance diagram for QgsVectorLayerFeatureIterator:
Inheritance graph
[legend]

Classes

struct  FetchJoinInfo
 Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes(). More...
 

Public Member Functions

 QgsVectorLayerFeatureIterator (QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request)
 
 ~QgsVectorLayerFeatureIterator ()
 
virtual bool close () override
 end of iterating: free the resources / lock More...
 
virtual bool rewind () override
 reset the iterator to the starting position More...
 
- Public Member Functions inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
 QgsAbstractFeatureIteratorFromSource (QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request)
 
 ~QgsAbstractFeatureIteratorFromSource ()
 
- Public Member Functions inherited from QgsAbstractFeatureIterator
 QgsAbstractFeatureIterator (const QgsFeatureRequest &request)
 base class constructor - stores the iteration parameters More...
 
virtual ~QgsAbstractFeatureIterator ()
 destructor makes sure that the iterator is closed properly More...
 
virtual bool nextFeature (QgsFeature &f)
 fetch next feature, return true on success More...
 

Protected Member Functions

void addExpressionAttribute (QgsFeature &f, int attrIndex)
 Adds an expression based attribute to a feature. More...
 
void addJoinedAttributes (QgsFeature &f)
 
void addVirtualAttributes (QgsFeature &f)
 Adds attributes that don't source from the provider but are added inside QGIS Includes. More...
 
virtual bool fetchFeature (QgsFeature &feature) override
 fetch next feature, return true on success More...
 
bool fetchNextAddedFeature (QgsFeature &f)
 
bool fetchNextChangedAttributeFeature (QgsFeature &f)
 
bool fetchNextChangedGeomFeature (QgsFeature &f)
 
bool nextFeatureFid (QgsFeature &f)
 
virtual bool nextFeatureFilterExpression (QgsFeature &f) override
 Overrides default method as we only need to filter features in the edit buffer while for others filtering is left to the provider implementation. More...
 
void prepareExpression (int fieldIdx)
 
void prepareField (int fieldIdx)
 
void prepareFields ()
 
void prepareJoin (int fieldIdx)
 
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod) override
 Setup the simplification of geometries to fetch using the specified simplify method. More...
 
void rewindEditBuffer ()
 
void updateChangedAttributes (QgsFeature &f)
 Update feature with uncommited attribute updates. More...
 
void updateFeatureGeometry (QgsFeature &f)
 Update feature with uncommited geometry updates. More...
 
void useAddedFeature (const QgsFeature &src, QgsFeature &f)
 
void useChangedAttributeFeature (QgsFeatureId fid, const QgsGeometry &geom, QgsFeature &f)
 
- Protected Member Functions inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
void iteratorClosed ()
 to be called by from subclass in close() More...
 
- Protected Member Functions inherited from QgsAbstractFeatureIterator
void deref ()
 remove reference, delete if refs == 0 More...
 
virtual bool nextFeatureFilterFids (QgsFeature &f)
 By default, the iterator will fetch all features and check if the id is in the request. More...
 
void ref ()
 add reference More...
 

Protected Attributes

QgsFeatureIterator mChangedFeaturesIterator
 
QgsFeatureRequest mChangedFeaturesRequest
 
QMap< int, QgsExpression * > mExpressionFieldInfo
 
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
 
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
 
QSet< QgsFeatureIdmFetchConsidered
 
bool mFetchedFid
 
QMap< const QgsVectorJoinInfo *, FetchJoinInfomFetchJoinInfo
 Information about joins used in the current select() statement. More...
 
bool mHasVirtualAttributes
 
QgsFeatureIterator mProviderIterator
 
QgsFeatureRequest mProviderRequest
 
- Protected Attributes inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
bool mOwnSource
 
QgsVectorLayerFeatureSourcemSource
 
- Protected Attributes inherited from QgsAbstractFeatureIterator
bool mClosed
 Set to true, as soon as the iterator is closed. More...
 
long mFetchedCount
 Number of features already fetched by iterator. More...
 
QgsFeatureRequest mRequest
 A copy of the feature request. More...
 
bool mZombie
 A feature iterator may be closed already but still be serving features from the cache. More...
 
int refs
 reference counting (to allow seamless copying of QgsFeatureIterator instances) TODO QGIS3: make this private More...
 

Detailed Description

Definition at line 74 of file qgsvectorlayerfeatureiterator.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerFeatureIterator()

QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator ( QgsVectorLayerFeatureSource source,
bool  ownSource,
const QgsFeatureRequest request 
)

Definition at line 93 of file qgsvectorlayerfeatureiterator.cpp.

◆ ~QgsVectorLayerFeatureIterator()

QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator ( )

Definition at line 181 of file qgsvectorlayerfeatureiterator.cpp.

Member Function Documentation

◆ addExpressionAttribute()

void QgsVectorLayerFeatureIterator::addExpressionAttribute ( QgsFeature f,
int  attrIndex 
)
protected

Adds an expression based attribute to a feature.

Parameters
ffeature
attrIndexattribute index
Note
added in QGIS 2.14
not available in Python bindings

Definition at line 722 of file qgsvectorlayerfeatureiterator.cpp.

◆ addJoinedAttributes()

void QgsVectorLayerFeatureIterator::addJoinedAttributes ( QgsFeature f)
protected
Note
not available in Python bindings

Definition at line 664 of file qgsvectorlayerfeatureiterator.cpp.

◆ addVirtualAttributes()

void QgsVectorLayerFeatureIterator::addVirtualAttributes ( QgsFeature f)
protected

Adds attributes that don't source from the provider but are added inside QGIS Includes.

  • Joined fields
  • Expression fields
Parameters
fThe feature will be modified
Note
not available in Python bindings

Definition at line 682 of file qgsvectorlayerfeatureiterator.cpp.

◆ close()

bool QgsVectorLayerFeatureIterator::close ( )
overridevirtual

end of iterating: free the resources / lock

Implements QgsAbstractFeatureIterator.

Definition at line 296 of file qgsvectorlayerfeatureiterator.cpp.

◆ fetchFeature()

bool QgsVectorLayerFeatureIterator::fetchFeature ( QgsFeature feature)
overrideprotectedvirtual

fetch next feature, return true on success

Implements QgsAbstractFeatureIterator.

Definition at line 193 of file qgsvectorlayerfeatureiterator.cpp.

◆ fetchNextAddedFeature()

bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature ( QgsFeature f)
protected
Note
not available in Python bindings

Definition at line 312 of file qgsvectorlayerfeatureiterator.cpp.

◆ fetchNextChangedAttributeFeature()

bool QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature ( QgsFeature f)
protected
Note
not available in Python bindings

Definition at line 392 of file qgsvectorlayerfeatureiterator.cpp.

◆ fetchNextChangedGeomFeature()

bool QgsVectorLayerFeatureIterator::fetchNextChangedGeomFeature ( QgsFeature f)
protected
Note
not available in Python bindings

Definition at line 365 of file qgsvectorlayerfeatureiterator.cpp.

◆ nextFeatureFid()

bool QgsVectorLayerFeatureIterator::nextFeatureFid ( QgsFeature f)
protected
Note
not available in Python bindings

Definition at line 871 of file qgsvectorlayerfeatureiterator.cpp.

◆ nextFeatureFilterExpression()

virtual bool QgsVectorLayerFeatureIterator::nextFeatureFilterExpression ( QgsFeature f)
inlineoverrideprotectedvirtual

Overrides default method as we only need to filter features in the edit buffer while for others filtering is left to the provider implementation.

Reimplemented from QgsAbstractFeatureIterator.

Definition at line 93 of file qgsvectorlayerfeatureiterator.h.

◆ prepareExpression()

void QgsVectorLayerFeatureIterator::prepareExpression ( int  fieldIdx)
protected
Note
not available in Python bindings

Definition at line 517 of file qgsvectorlayerfeatureiterator.cpp.

◆ prepareField()

void QgsVectorLayerFeatureIterator::prepareField ( int  fieldIdx)
protected
Note
not available in Python bindings

Definition at line 642 of file qgsvectorlayerfeatureiterator.cpp.

◆ prepareFields()

void QgsVectorLayerFeatureIterator::prepareFields ( )
protected
Note
not available in Python bindings

Definition at line 553 of file qgsvectorlayerfeatureiterator.cpp.

◆ prepareJoin()

void QgsVectorLayerFeatureIterator::prepareJoin ( int  fieldIdx)
protected
Note
not available in Python bindings

Definition at line 471 of file qgsvectorlayerfeatureiterator.cpp.

◆ prepareSimplification()

bool QgsVectorLayerFeatureIterator::prepareSimplification ( const QgsSimplifyMethod simplifyMethod)
overrideprotectedvirtual

Setup the simplification of geometries to fetch using the specified simplify method.

Reimplemented from QgsAbstractFeatureIterator.

Definition at line 731 of file qgsvectorlayerfeatureiterator.cpp.

◆ rewind()

bool QgsVectorLayerFeatureIterator::rewind ( )
overridevirtual

reset the iterator to the starting position

Implements QgsAbstractFeatureIterator.

Definition at line 278 of file qgsvectorlayerfeatureiterator.cpp.

◆ rewindEditBuffer()

void QgsVectorLayerFeatureIterator::rewindEditBuffer ( )
protected
Note
not available in Python bindings

Definition at line 463 of file qgsvectorlayerfeatureiterator.cpp.

◆ updateChangedAttributes()

void QgsVectorLayerFeatureIterator::updateChangedAttributes ( QgsFeature f)
protected

Update feature with uncommited attribute updates.

Note
not available in Python bindings

Definition at line 914 of file qgsvectorlayerfeatureiterator.cpp.

◆ updateFeatureGeometry()

void QgsVectorLayerFeatureIterator::updateFeatureGeometry ( QgsFeature f)
protected

Update feature with uncommited geometry updates.

Note
not available in Python bindings

Definition at line 937 of file qgsvectorlayerfeatureiterator.cpp.

◆ useAddedFeature()

void QgsVectorLayerFeatureIterator::useAddedFeature ( const QgsFeature src,
QgsFeature f 
)
protected
Note
not available in Python bindings

Definition at line 336 of file qgsvectorlayerfeatureiterator.cpp.

◆ useChangedAttributeFeature()

void QgsVectorLayerFeatureIterator::useChangedAttributeFeature ( QgsFeatureId  fid,
const QgsGeometry geom,
QgsFeature f 
)
protected
Note
not available in Python bindings

Definition at line 418 of file qgsvectorlayerfeatureiterator.cpp.

Member Data Documentation

◆ mChangedFeaturesIterator

QgsFeatureIterator QgsVectorLayerFeatureIterator::mChangedFeaturesIterator
protected

Definition at line 176 of file qgsvectorlayerfeatureiterator.h.

◆ mChangedFeaturesRequest

QgsFeatureRequest QgsVectorLayerFeatureIterator::mChangedFeaturesRequest
protected

Definition at line 175 of file qgsvectorlayerfeatureiterator.h.

◆ mExpressionFieldInfo

QMap<int, QgsExpression*> QgsVectorLayerFeatureIterator::mExpressionFieldInfo
protected

Definition at line 189 of file qgsvectorlayerfeatureiterator.h.

◆ mFetchAddedFeaturesIt

QgsFeatureMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchAddedFeaturesIt
protected

Definition at line 181 of file qgsvectorlayerfeatureiterator.h.

◆ mFetchChangedGeomIt

QgsGeometryMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchChangedGeomIt
protected

Definition at line 180 of file qgsvectorlayerfeatureiterator.h.

◆ mFetchConsidered

QSet<QgsFeatureId> QgsVectorLayerFeatureIterator::mFetchConsidered
protected

Definition at line 179 of file qgsvectorlayerfeatureiterator.h.

◆ mFetchedFid

bool QgsVectorLayerFeatureIterator::mFetchedFid
protected

Definition at line 183 of file qgsvectorlayerfeatureiterator.h.

◆ mFetchJoinInfo

QMap<const QgsVectorJoinInfo*, FetchJoinInfo> QgsVectorLayerFeatureIterator::mFetchJoinInfo
protected

Information about joins used in the current select() statement.

Allows faster mapping of attribute ids compared to mVectorJoins

Definition at line 187 of file qgsvectorlayerfeatureiterator.h.

◆ mHasVirtualAttributes

bool QgsVectorLayerFeatureIterator::mHasVirtualAttributes
protected

Definition at line 191 of file qgsvectorlayerfeatureiterator.h.

◆ mProviderIterator

QgsFeatureIterator QgsVectorLayerFeatureIterator::mProviderIterator
protected

Definition at line 174 of file qgsvectorlayerfeatureiterator.h.

◆ mProviderRequest

QgsFeatureRequest QgsVectorLayerFeatureIterator::mProviderRequest
protected

Definition at line 173 of file qgsvectorlayerfeatureiterator.h.


The documentation for this class was generated from the following files: