28 , mCompileStatus( NoCompilation )
29 , mUseCachedFeatures( false )
45 if ( mUseCachedFeatures )
47 if ( mFeatureIterator != mCachedFeatures.
constEnd() )
49 f = mFeatureIterator->mFeature;
131 Q_UNUSED( simplifyMethod );
138 if ( !orderBys.
isEmpty() && !prepareOrderBy( orderBys ) )
149 orderByIt->expression().prepare( expressionContext );
151 while ( ++orderByIt != preparedOrderBys.
end() );
159 expressionContext->setFeature( indexedFeature.
mFeature );
169 mCachedFeatures.
append( indexedFeature );
172 qSort( mCachedFeatures.
begin(), mCachedFeatures.
end(), QgsExpressionSorter( preparedOrderBys ) );
174 mFeatureIterator = mCachedFeatures.
constBegin();
175 mUseCachedFeatures =
true;
183 Q_UNUSED( methodType )
201 if (
this != &other )
Wrapper for iterator of features from vector data provider or vector layer.
long limit() const
Returns the maximum number of features to request, or -1 if no limit set.
Filter using feature IDs.
Q_DECL_DEPRECATED QVariant evaluate(const QgsFeature *f)
Evaluate the feature and return the result.
long mFetchedCount
Number of features already fetched by iterator.
virtual bool fetchFeature(QgsFeature &f)=0
If you write a feature iterator for your provider, this is the method you need to implement!! ...
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
FilterType filterType() const
Return the filter type which is currently set on this request.
const QgsFeatureIds & filterFids() const
Get feature IDs that should be fetched.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsExpression * filterExpression() const
Returns the filter expression if set.
Interface that can be optionaly attached to an iterator so its nextFeature() implementaton can check ...
void append(const T &value)
virtual bool nextFeature(QgsFeature &f)
fetch next feature, return true on success
Temporarily used structure to cache order by information.
QgsFeatureIterator & operator=(const QgsFeatureIterator &other)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual bool nextFeatureFilterExpression(QgsFeature &f)
By default, the iterator will fetch all features and check if the feature matches the expression...
bool mZombie
A feature iterator may be closed already but still be serving features from the cache.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
void deref()
remove reference, delete if refs == 0
QgsFeatureId id() const
Get the feature ID for this feature.
virtual bool nextFeatureFilterFids(QgsFeature &f)
By default, the iterator will fetch all features and check if the id is in the request.
The OrderByClause class represents an order by clause for a QgsFeatureRequest.
bool contains(const T &value) const
QgsFeatureRequest mRequest
A copy of the feature request.
QgsExpression expression() const
The expression.
virtual void setInterruptionChecker(QgsInterruptionChecker *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped...
QgsAbstractFeatureIterator * mIter
QVector< QVariant > mIndexes
void replace(int i, const T &value)
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
int refs
reference counting (to allow seamless copying of QgsFeatureIterator instances) TODO QGIS3: make this ...
const_iterator constEnd() const
const_iterator constBegin() const
OrderBy orderBy() const
Return a list of order by clauses specified for this feature request.
virtual bool prepareSimplification(const QgsSimplifyMethod &simplifyMethod)
Setup the simplification of geometries to fetch using the specified simplify method.
virtual ~QgsAbstractFeatureIterator()
destructor makes sure that the iterator is closed properly
const QgsSimplifyMethod & simplifyMethod() const
Get simplification method for geometries that will be fetched.
QgsAbstractFeatureIterator(const QgsFeatureRequest &request)
base class constructor - stores the iteration parameters