QGIS API Documentation  2.5.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 rewind ()
 reset the iterator to the starting position More...
 
virtual bool close ()
 end of iterating: free the resources / lock 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

virtual bool fetchFeature (QgsFeature &feature)
 fetch next feature, return true on success More...
 
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...
 
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod)
 Setup the simplification of geometries to fetch using the specified simplify method. More...
 
void rewindEditBuffer ()
 
void prepareJoins ()
 
void prepareExpressions ()
 
bool fetchNextAddedFeature (QgsFeature &f)
 
bool fetchNextChangedGeomFeature (QgsFeature &f)
 
bool fetchNextChangedAttributeFeature (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 addVirtualAttributes (QgsFeature &f)
 Adds attributes that don't source from the provider but are added inside QGIS Includes. More...
 
void updateChangedAttributes (QgsFeature &f)
 Update feature with uncommited attribute updates. More...
 
void updateFeatureGeometry (QgsFeature &f)
 Update feature with uncommited geometry updates. More...
 
- Protected Member Functions inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
void iteratorClosed ()
 to be called by from subclass in close() More...
 
- Protected Member Functions inherited from QgsAbstractFeatureIterator
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...
 
void deref ()
 remove reference, delete if refs == 0 More...
 

Protected Attributes

QgsFeatureRequest mProviderRequest
 
QgsFeatureIterator mProviderIterator
 
QgsFeatureRequest mChangedFeaturesRequest
 
QgsFeatureIterator mChangedFeaturesIterator
 
QSet< QgsFeatureIdmFetchConsidered
 
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
 
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
 
bool mFetchedFid
 
QMap< QgsVectorLayer
*, FetchJoinInfo
mFetchJoinInfo
 information about joins used in the current select() statement. More...
 
QMap< int, QgsExpression * > mExpressionFieldInfo
 
bool mHasVirtualAttributes
 
- Protected Attributes inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
QgsVectorLayerFeatureSourcemSource
 
bool mOwnSource
 
- Protected Attributes inherited from QgsAbstractFeatureIterator
QgsFeatureRequest mRequest
 A copy of the feature request. More...
 
bool mClosed
 Set to true, as soon as the iterator is closed. More...
 
int refs
 reference counting (to allow seamless copying of QgsFeatureIterator instances) More...
 

Constructor & Destructor Documentation

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

Member Function Documentation

void QgsVectorLayerFeatureIterator::addJoinedAttributes ( QgsFeature f)
protected
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
bool QgsVectorLayerFeatureIterator::close ( )
virtual

end of iterating: free the resources / lock

Implements QgsAbstractFeatureIterator.

bool QgsVectorLayerFeatureIterator::fetchFeature ( QgsFeature feature)
protectedvirtual

fetch next feature, return true on success

Implements QgsAbstractFeatureIterator.

bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature ( QgsFeature f)
protected
bool QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature ( QgsFeature f)
protected
bool QgsVectorLayerFeatureIterator::fetchNextChangedGeomFeature ( QgsFeature f)
protected
bool QgsVectorLayerFeatureIterator::nextFeatureFid ( QgsFeature f)
protected
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.

void QgsVectorLayerFeatureIterator::prepareExpressions ( )
protected
void QgsVectorLayerFeatureIterator::prepareJoins ( )
protected
bool QgsVectorLayerFeatureIterator::prepareSimplification ( const QgsSimplifyMethod simplifyMethod)
protectedvirtual

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

Reimplemented from QgsAbstractFeatureIterator.

bool QgsVectorLayerFeatureIterator::rewind ( )
virtual

reset the iterator to the starting position

Implements QgsAbstractFeatureIterator.

void QgsVectorLayerFeatureIterator::rewindEditBuffer ( )
protected
void QgsVectorLayerFeatureIterator::updateChangedAttributes ( QgsFeature f)
protected

Update feature with uncommited attribute updates.

void QgsVectorLayerFeatureIterator::updateFeatureGeometry ( QgsFeature f)
protected

Update feature with uncommited geometry updates.

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

Member Data Documentation

QgsFeatureIterator QgsVectorLayerFeatureIterator::mChangedFeaturesIterator
protected
QgsFeatureRequest QgsVectorLayerFeatureIterator::mChangedFeaturesRequest
protected
QMap<int, QgsExpression*> QgsVectorLayerFeatureIterator::mExpressionFieldInfo
protected
QgsFeatureMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchAddedFeaturesIt
protected
QgsGeometryMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchChangedGeomIt
protected
QSet<QgsFeatureId> QgsVectorLayerFeatureIterator::mFetchConsidered
protected
bool QgsVectorLayerFeatureIterator::mFetchedFid
protected
QMap<QgsVectorLayer*, FetchJoinInfo> QgsVectorLayerFeatureIterator::mFetchJoinInfo
protected

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

Allows faster mapping of attribute ids compared to mVectorJoins

bool QgsVectorLayerFeatureIterator::mHasVirtualAttributes
protected
QgsFeatureIterator QgsVectorLayerFeatureIterator::mProviderIterator
protected
QgsFeatureRequest QgsVectorLayerFeatureIterator::mProviderRequest
protected

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