QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 ()
 end of iterating: free the resources / lock More...
 
virtual bool rewind ()
 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 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)
 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)
 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 prepareExpressions ()
 
void prepareJoins ()
 
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod)
 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< QgsVectorLayer
*, FetchJoinInfo
mFetchJoinInfo
 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...
 
QgsFeatureRequest mRequest
 A copy of the feature request. More...
 
int refs
 reference counting (to allow seamless copying of QgsFeatureIterator instances) More...
 

Detailed Description

Definition at line 69 of file qgsvectorlayerfeatureiterator.h.

Constructor & Destructor Documentation

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

Definition at line 88 of file qgsvectorlayerfeatureiterator.cpp.

QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator ( )

Definition at line 151 of file qgsvectorlayerfeatureiterator.cpp.

Member Function Documentation

void QgsVectorLayerFeatureIterator::addJoinedAttributes ( QgsFeature f)
protected

Definition at line 526 of file qgsvectorlayerfeatureiterator.cpp.

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

Definition at line 546 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::close ( )
virtual

end of iterating: free the resources / lock

Implements QgsAbstractFeatureIterator.

Definition at line 255 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::fetchFeature ( QgsFeature feature)
protectedvirtual

fetch next feature, return true on success

Implements QgsAbstractFeatureIterator.

Definition at line 163 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature ( QgsFeature f)
protected

Definition at line 271 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature ( QgsFeature f)
protected

Definition at line 351 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::fetchNextChangedGeomFeature ( QgsFeature f)
protected

Definition at line 324 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::nextFeatureFid ( QgsFeature f)
protected

Definition at line 715 of file qgsvectorlayerfeatureiterator.cpp.

virtual bool QgsVectorLayerFeatureIterator::nextFeatureFilterExpression ( QgsFeature f)
inlineprotectedvirtual

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 88 of file qgsvectorlayerfeatureiterator.h.

void QgsVectorLayerFeatureIterator::prepareExpressions ( )
protected

Definition at line 489 of file qgsvectorlayerfeatureiterator.cpp.

void QgsVectorLayerFeatureIterator::prepareJoins ( )
protected

Definition at line 434 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::prepareSimplification ( const QgsSimplifyMethod simplifyMethod)
protectedvirtual

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

Reimplemented from QgsAbstractFeatureIterator.

Definition at line 568 of file qgsvectorlayerfeatureiterator.cpp.

bool QgsVectorLayerFeatureIterator::rewind ( )
virtual

reset the iterator to the starting position

Implements QgsAbstractFeatureIterator.

Definition at line 237 of file qgsvectorlayerfeatureiterator.cpp.

void QgsVectorLayerFeatureIterator::rewindEditBuffer ( )
protected

Definition at line 424 of file qgsvectorlayerfeatureiterator.cpp.

void QgsVectorLayerFeatureIterator::updateChangedAttributes ( QgsFeature f)
protected

Update feature with uncommited attribute updates.

Definition at line 756 of file qgsvectorlayerfeatureiterator.cpp.

void QgsVectorLayerFeatureIterator::updateFeatureGeometry ( QgsFeature f)
protected

Update feature with uncommited geometry updates.

Definition at line 778 of file qgsvectorlayerfeatureiterator.cpp.

void QgsVectorLayerFeatureIterator::useAddedFeature ( const QgsFeature src,
QgsFeature f 
)
protected

Definition at line 295 of file qgsvectorlayerfeatureiterator.cpp.

void QgsVectorLayerFeatureIterator::useChangedAttributeFeature ( QgsFeatureId  fid,
const QgsGeometry geom,
QgsFeature f 
)
protected

Definition at line 379 of file qgsvectorlayerfeatureiterator.cpp.

Member Data Documentation

QgsFeatureIterator QgsVectorLayerFeatureIterator::mChangedFeaturesIterator
protected

Definition at line 97 of file qgsvectorlayerfeatureiterator.h.

QgsFeatureRequest QgsVectorLayerFeatureIterator::mChangedFeaturesRequest
protected

Definition at line 96 of file qgsvectorlayerfeatureiterator.h.

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

Definition at line 153 of file qgsvectorlayerfeatureiterator.h.

QgsFeatureMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchAddedFeaturesIt
protected

Definition at line 103 of file qgsvectorlayerfeatureiterator.h.

QgsGeometryMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchChangedGeomIt
protected

Definition at line 102 of file qgsvectorlayerfeatureiterator.h.

QSet<QgsFeatureId> QgsVectorLayerFeatureIterator::mFetchConsidered
protected

Definition at line 101 of file qgsvectorlayerfeatureiterator.h.

bool QgsVectorLayerFeatureIterator::mFetchedFid
protected

Definition at line 105 of file qgsvectorlayerfeatureiterator.h.

QMap<QgsVectorLayer*, 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 151 of file qgsvectorlayerfeatureiterator.h.

bool QgsVectorLayerFeatureIterator::mHasVirtualAttributes
protected

Definition at line 155 of file qgsvectorlayerfeatureiterator.h.

QgsFeatureIterator QgsVectorLayerFeatureIterator::mProviderIterator
protected

Definition at line 95 of file qgsvectorlayerfeatureiterator.h.

QgsFeatureRequest QgsVectorLayerFeatureIterator::mProviderRequest
protected

Definition at line 94 of file qgsvectorlayerfeatureiterator.h.


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