QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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
virtual bool close ()
 end of iterating: free the resources / lock
- 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
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 ()
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.
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 QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
void iteratorClosed ()
 to be called by from subclass in close()
- 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

QgsFeatureRequest mProviderRequest
QgsFeatureIterator mProviderIterator
QgsFeatureRequest mChangedFeaturesRequest
QgsFeatureIterator mChangedFeaturesIterator
QSet< QgsFeatureId > mFetchConsidered
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
bool mFetchedFid
QMap< QgsVectorLayer
*, FetchJoinInfo > 
mFetchJoinInfo
 information about joins used in the current select() statement.
QMap< int, QgsExpression * > mExpressionFieldInfo
bool mHasVirtualAttributes
- Protected Attributes inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource >
QgsVectorLayerFeatureSource * mSource
bool mOwnSource
- 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)

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: