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

Uses another iterator as backend and writes features to the cache. More...

#include <qgscachedfeatureiterator.h>

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

Public Member Functions

 QgsCachedFeatureWriterIterator (QgsVectorLayerCache *vlCache, QgsFeatureRequest featureRequest)
 This constructor creates a feature iterator, which queries the backend and caches retrieved features.
virtual bool rewind ()
 Rewind to the beginning of the iterator.
virtual bool close ()
 Close this iterator.
- 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 &f)
 Implementation for fetching a feature.
- Protected Member Functions inherited from QgsAbstractFeatureIterator
virtual bool nextFeatureFilterExpression (QgsFeature &f)
 By default, the iterator will fetch all features and check if the feature matches the expression.
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
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod)
 Setup the simplification of geometries to fetch using the specified simplify method.

Private Attributes

QgsFeatureIterator mFeatIt
QgsVectorLayerCachemVectorLayerCache
QgsFeatureIds mFids

Additional Inherited Members

- 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)

Detailed Description

Uses another iterator as backend and writes features to the cache.

Definition at line 98 of file qgscachedfeatureiterator.h.

Constructor & Destructor Documentation

QgsCachedFeatureWriterIterator::QgsCachedFeatureWriterIterator ( QgsVectorLayerCache vlCache,
QgsFeatureRequest  featureRequest 
)

This constructor creates a feature iterator, which queries the backend and caches retrieved features.

Parameters
vlCacheThe vector layer cache to use
featureRequestThe feature request to answer

Definition at line 84 of file qgscachedfeatureiterator.cpp.

References QgsVectorLayer::getFeatures(), QgsVectorLayerCache::layer(), and mFeatIt.

Member Function Documentation

bool QgsCachedFeatureWriterIterator::close ( )
virtual

Close this iterator.

No further features will be available.

Returns
true if successful

Implements QgsAbstractFeatureIterator.

Definition at line 115 of file qgscachedfeatureiterator.cpp.

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

bool QgsCachedFeatureWriterIterator::fetchFeature ( QgsFeature f)
protectedvirtual

Implementation for fetching a feature.

Parameters
fWill write to this feature
Returns
bool true if the operation was ok
See Also
bool getFeature( QgsFeature& f )

Implements QgsAbstractFeatureIterator.

Definition at line 91 of file qgscachedfeatureiterator.cpp.

References QgsVectorLayerCache::cacheFeature(), QgsFeature::id(), mFeatIt, mFids, QgsAbstractFeatureIterator::mRequest, mVectorLayerCache, QgsFeatureIterator::nextFeature(), and QgsVectorLayerCache::requestCompleted().

bool QgsCachedFeatureWriterIterator::rewind ( )
virtual

Rewind to the beginning of the iterator.

Returns
bool true if the operation was ok

Implements QgsAbstractFeatureIterator.

Definition at line 109 of file qgscachedfeatureiterator.cpp.

References mFeatIt, mFids, and QgsFeatureIterator::rewind().

Member Data Documentation

QgsFeatureIterator QgsCachedFeatureWriterIterator::mFeatIt
private
QgsFeatureIds QgsCachedFeatureWriterIterator::mFids
private

Definition at line 138 of file qgscachedfeatureiterator.h.

Referenced by fetchFeature(), and rewind().

QgsVectorLayerCache* QgsCachedFeatureWriterIterator::mVectorLayerCache
private

Definition at line 137 of file qgscachedfeatureiterator.h.

Referenced by fetchFeature().


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