QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
QgsVectorLayerFeatureIterator Class Reference

#include <qgsvectorlayerfeatureiterator.h>

Inheritance diagram for QgsVectorLayerFeatureIterator:
Inheritance graph
[legend]
Collaboration diagram for QgsVectorLayerFeatureIterator:
Collaboration graph
[legend]

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 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
virtual bool nextFeature (QgsFeature &f)
 fetch next feature, return true on success

Protected Member Functions

virtual bool fetchFeature (QgsFeature &feature)
 fetch next feature, return true on success
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.
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod)
 Setup the simplification of geometries to fetch using the specified simplify method.
void rewindEditBuffer ()
void prepareJoins ()
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 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
virtual bool nextFeatureFilterFids (QgsFeature &f)
 By default, the iterator will fetch all features and check if the id is in the request.
void ref ()
 add reference
void deref ()
 remove reference, delete if refs == 0

Protected Attributes

QgsVectorLayerL
QgsFeatureRequest mProviderRequest
QgsFeatureIterator mProviderIterator
QgsFeatureRequest mChangedFeaturesRequest
QgsFeatureIterator mChangedFeaturesIterator
QSet< QgsFeatureIdmFetchConsidered
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
bool mFetchedFid
QgsFeatureMap mAddedFeatures
QgsGeometryMap mChangedGeometries
QgsFeatureIds mDeletedFeatureIds
QList< QgsFieldmAddedAttributes
QgsChangedAttributesMap mChangedAttributeValues
QgsAttributeList mDeletedAttributeIds
QMap< QgsVectorLayer
*, FetchJoinInfo
mFetchJoinInfo
 Informations about joins used in the current select() statement.
- Protected Attributes inherited from QgsAbstractFeatureIterator
QgsFeatureRequest mRequest
 A copy of the feature request.
bool mClosed
 Set to true, as soon as the iterator is closed.
int refs
 reference counting (to allow seamless copying of QgsFeatureIterator instances)

Private Member Functions

virtual bool providerCanSimplify (QgsSimplifyMethod::MethodType methodType) const
 returns whether the iterator supports simplify geometries on provider side

Private Attributes

QgsAbstractGeometrySimplifiermEditGeometrySimplifier
 optional object to locally simplify edited (changed or added) geometries fetched by this feature iterator

Detailed Description

Definition at line 28 of file qgsvectorlayerfeatureiterator.h.

Constructor & Destructor Documentation

QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator ( QgsVectorLayer layer,
const QgsFeatureRequest request 
)
QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator ( )

Definition at line 114 of file qgsvectorlayerfeatureiterator.cpp.

References close(), and mEditGeometrySimplifier.

Member Function Documentation

void QgsVectorLayerFeatureIterator::addJoinedAttributes ( QgsFeature f)
protected
bool QgsVectorLayerFeatureIterator::close ( )
virtual

end of iterating: free the resources / lock

Implements QgsAbstractFeatureIterator.

Definition at line 215 of file qgsvectorlayerfeatureiterator.cpp.

References QgsFeatureIterator::close(), QgsAbstractFeatureIterator::mClosed, and mProviderIterator.

Referenced by fetchFeature(), and ~QgsVectorLayerFeatureIterator().

bool QgsVectorLayerFeatureIterator::fetchFeature ( QgsFeature feature)
protectedvirtual
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.

Definition at line 47 of file qgsvectorlayerfeatureiterator.h.

References QgsAbstractFeatureIterator::fetchFeature().

void QgsVectorLayerFeatureIterator::prepareJoins ( )
protected
bool QgsVectorLayerFeatureIterator::prepareSimplification ( const QgsSimplifyMethod simplifyMethod)
protectedvirtual
bool QgsVectorLayerFeatureIterator::providerCanSimplify ( QgsSimplifyMethod::MethodType  methodType) const
privatevirtual
bool QgsVectorLayerFeatureIterator::rewind ( )
virtual
void QgsVectorLayerFeatureIterator::rewindEditBuffer ( )
protected
void QgsVectorLayerFeatureIterator::updateChangedAttributes ( QgsFeature f)
protected
void QgsVectorLayerFeatureIterator::updateFeatureGeometry ( QgsFeature f)
protected

Update feature with uncommited geometry updates.

Definition at line 667 of file qgsvectorlayerfeatureiterator.cpp.

References QgsFeature::id(), mChangedGeometries, and QgsFeature::setGeometry().

Referenced by fetchFeature().

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

Member Data Documentation

QgsVectorLayer* QgsVectorLayerFeatureIterator::L
protected
QList<QgsField> QgsVectorLayerFeatureIterator::mAddedAttributes
protected
QgsFeatureMap QgsVectorLayerFeatureIterator::mAddedFeatures
protected
QgsChangedAttributesMap QgsVectorLayerFeatureIterator::mChangedAttributeValues
protected
QgsFeatureIterator QgsVectorLayerFeatureIterator::mChangedFeaturesIterator
protected
QgsFeatureRequest QgsVectorLayerFeatureIterator::mChangedFeaturesRequest
protected

Definition at line 56 of file qgsvectorlayerfeatureiterator.h.

Referenced by QgsVectorLayerFeatureIterator().

QgsGeometryMap QgsVectorLayerFeatureIterator::mChangedGeometries
protected
QgsAttributeList QgsVectorLayerFeatureIterator::mDeletedAttributeIds
protected
QgsFeatureIds QgsVectorLayerFeatureIterator::mDeletedFeatureIds
protected
QgsAbstractGeometrySimplifier* QgsVectorLayerFeatureIterator::mEditGeometrySimplifier
private

optional object to locally simplify edited (changed or added) geometries fetched by this feature iterator

Definition at line 123 of file qgsvectorlayerfeatureiterator.h.

Referenced by prepareSimplification(), useAddedFeature(), useChangedAttributeFeature(), and ~QgsVectorLayerFeatureIterator().

QgsFeatureMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchAddedFeaturesIt
protected

Definition at line 71 of file qgsvectorlayerfeatureiterator.h.

Referenced by fetchNextAddedFeature(), and rewindEditBuffer().

QgsGeometryMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchChangedGeomIt
protected
QSet<QgsFeatureId> QgsVectorLayerFeatureIterator::mFetchConsidered
protected
bool QgsVectorLayerFeatureIterator::mFetchedFid
protected
QMap<QgsVectorLayer*, FetchJoinInfo> QgsVectorLayerFeatureIterator::mFetchJoinInfo
protected

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

Allows faster mapping of attribute ids compared to mVectorJoins

Definition at line 119 of file qgsvectorlayerfeatureiterator.h.

Referenced by addJoinedAttributes(), fetchFeature(), nextFeatureFid(), prepareJoins(), useAddedFeature(), and useChangedAttributeFeature().

QgsFeatureIterator QgsVectorLayerFeatureIterator::mProviderIterator
protected
QgsFeatureRequest QgsVectorLayerFeatureIterator::mProviderRequest
protected

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