QGIS API Documentation  2.3.0-Master
 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 (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 ()
 
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. 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
 Informations about joins used in the current select() statement. More...
 
- 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...
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 67 of file qgsvectorlayerfeatureiterator.h.

Constructor & Destructor Documentation

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

Definition at line 145 of file qgsvectorlayerfeatureiterator.cpp.

References close(), and mEditGeometrySimplifier.

Member Function Documentation

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

Definition at line 94 of file qgsvectorlayerfeatureiterator.h.

Referenced by QgsVectorLayerFeatureIterator().

QgsAbstractGeometrySimplifier* QgsVectorLayerFeatureIterator::mEditGeometrySimplifier
private

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

Definition at line 143 of file qgsvectorlayerfeatureiterator.h.

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

QgsFeatureMap::ConstIterator QgsVectorLayerFeatureIterator::mFetchAddedFeaturesIt
protected

Definition at line 101 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 139 of file qgsvectorlayerfeatureiterator.h.

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

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

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