QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsAbstractFeatureIteratorFromSource< T > Class Template Reference

Helper template that cares of two things: 1. More...

#include <qgsfeatureiterator.h>

Inheritance diagram for QgsAbstractFeatureIteratorFromSource< T >:
Inheritance graph
[legend]

Public Member Functions

 QgsAbstractFeatureIteratorFromSource (T *source, bool ownSource, const QgsFeatureRequest &request)
 
 ~QgsAbstractFeatureIteratorFromSource () override
 
- Public Member Functions inherited from QgsAbstractFeatureIterator
 QgsAbstractFeatureIterator (const QgsFeatureRequest &request)
 base class constructor - stores the iteration parameters More...
 
virtual ~QgsAbstractFeatureIterator ()=default
 destructor makes sure that the iterator is closed properly More...
 
virtual bool close ()=0
 end of iterating: free the resources / lock More...
 
bool compileFailed () const
 Indicator if there was an error when sending the compiled query to the server. More...
 
CompileStatus compileStatus () const
 Returns the status of expression compilation for filter expression requests. More...
 
virtual bool isValid () const
 Returns if this iterator is valid. More...
 
virtual bool nextFeature (QgsFeature &f)
 fetch next feature, return true on success More...
 
virtual bool rewind ()=0
 reset the iterator to the starting position More...
 
virtual void setInterruptionChecker (QgsFeedback *interruptionChecker)
 Attach an object that can be queried regularly by the iterator to check if it must stopped. More...
 

Protected Member Functions

void iteratorClosed ()
 to be called by from subclass in close() More...
 
- Protected Member Functions inherited from QgsAbstractFeatureIterator
void deref ()
 Remove reference, delete if refs == 0. More...
 
virtual bool fetchFeature (QgsFeature &f)=0
 If you write a feature iterator for your provider, this is the method you need to implement!! More...
 
QgsRectangle filterRectToSourceCrs (const QgsCoordinateTransform &transform) const SIP_THROW(QgsCsException)
 Returns a rectangle representing the original request's QgsFeatureRequest::filterRect(). More...
 
void geometryToDestinationCrs (QgsFeature &feature, const QgsCoordinateTransform &transform) const
 Transforms feature's geometry according to the specified coordinate transform. More...
 
virtual bool nextFeatureFilterExpression (QgsFeature &f)
 By default, the iterator will fetch all features and check if the feature matches the expression. More...
 
virtual bool nextFeatureFilterFids (QgsFeature &f)
 By default, the iterator will fetch all features and check if the id is in the request. More...
 
virtual bool prepareSimplification (const QgsSimplifyMethod &simplifyMethod)
 Setup the simplification of geometries to fetch using the specified simplify method. More...
 
void ref ()
 Add reference. More...
 
RequestToSourceCrsResult updateRequestToSourceCrs (QgsFeatureRequest &request, const QgsCoordinateTransform &transform) const SIP_THROW(QgsCsException)
 Update a QgsFeatureRequest so that spatial filters are transformed to the source's coordinate reference system. More...
 

Protected Attributes

bool mOwnSource
 
T * mSource = nullptr
 
- Protected Attributes inherited from QgsAbstractFeatureIterator
bool mClosed = false
 Sets to true, as soon as the iterator is closed. More...
 
bool mCompileFailed = false
 
CompileStatus mCompileStatus = NoCompilation
 Status of compilation of filter expression. More...
 
long long mFetchedCount = 0
 Number of features already fetched by iterator. More...
 
QgsFeatureRequest mRequest
 A copy of the feature request. More...
 
bool mValid = true
 An invalid state of a feature iterator indicates that there was a problem with even getting it up and running. More...
 
bool mZombie = false
 A feature iterator may be closed already but still be serving features from the cache. More...
 
int refs = 0
 reference counting (to allow seamless copying of QgsFeatureIterator instances) More...
 

Additional Inherited Members

- Public Types inherited from QgsAbstractFeatureIterator
enum  CompileStatus { NoCompilation , PartiallyCompiled , Compiled }
 Status of expression compilation for filter expression requests. More...
 
enum class  RequestToSourceCrsResult : int { Success , DistanceWithinMustBeCheckedManually }
 Possible results from the updateRequestToSourceCrs() method. More...
 

Detailed Description

template<typename T>
class QgsAbstractFeatureIteratorFromSource< T >

Helper template that cares of two things: 1.

automatic deletion of source if owned by iterator, 2. notification of open/closed iterator.

Note
not available in Python bindings (although present in SIP file)

Definition at line 259 of file qgsfeatureiterator.h.

Constructor & Destructor Documentation

◆ QgsAbstractFeatureIteratorFromSource()

template<typename T >
QgsAbstractFeatureIteratorFromSource< T >::QgsAbstractFeatureIteratorFromSource ( T *  source,
bool  ownSource,
const QgsFeatureRequest request 
)
inline

Definition at line 262 of file qgsfeatureiterator.h.

◆ ~QgsAbstractFeatureIteratorFromSource()

template<typename T >
QgsAbstractFeatureIteratorFromSource< T >::~QgsAbstractFeatureIteratorFromSource ( )
inlineoverride

Definition at line 270 of file qgsfeatureiterator.h.

Member Function Documentation

◆ iteratorClosed()

template<typename T >
void QgsAbstractFeatureIteratorFromSource< T >::iteratorClosed ( )
inlineprotected

to be called by from subclass in close()

Definition at line 278 of file qgsfeatureiterator.h.

Member Data Documentation

◆ mOwnSource

template<typename T >
bool QgsAbstractFeatureIteratorFromSource< T >::mOwnSource
protected

Definition at line 281 of file qgsfeatureiterator.h.

◆ mSource

template<typename T >
T* QgsAbstractFeatureIteratorFromSource< T >::mSource = nullptr
protected

Definition at line 280 of file qgsfeatureiterator.h.


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