15 #ifndef QGSVECTORLAYERFEATUREITERATOR_H 16 #define QGSVECTORLAYERFEATUREITERATOR_H 18 #include "qgis_core.h" 131 bool close()
override;
148 void addJoinedAttributesCached(
QgsFeature &f,
const QVariant &joinValue )
const;
149 void addJoinedAttributesDirect(
QgsFeature &f,
const QVariant &joinValue )
const;
153 bool isValid()
const override;
157 bool fetchFeature(
QgsFeature &feature )
override;
172 void prepareJoin(
int fieldIdx )
SIP_SKIP;
175 void prepareExpression(
int fieldIdx )
SIP_SKIP;
181 void prepareField(
int fieldIdx )
SIP_SKIP;
248 QMap<const QgsVectorLayerJoinInfo *, QgsVectorLayerFeatureIterator::FetchJoinInfo>
mFetchJoinInfo;
259 void createExpressionContext();
260 std::unique_ptr<QgsExpressionContext> mExpressionContext;
264 QList< int > mPreparedFields;
265 QList< int > mFieldsToPrepare;
268 QList< FetchJoinInfo > mOrderedJoinInfoList;
274 bool prepareOrderBy(
const QList<QgsFeatureRequest::OrderByClause> &orderBys )
override;
279 void createOrderedJoinList();
284 bool postProcessFeature(
QgsFeature &feature );
289 bool checkGeometryValidity(
const QgsFeature &feature );
327 QPointer< QgsVectorLayer > mLayer;
338 QgsVectorLayerSelectedFeatureIterator(
const QgsFeatureIds &selectedFeatureIds,
342 bool rewind()
override;
343 bool close()
override;
358 #endif // QGSVECTORLAYERFEATUREITERATOR_H Wrapper for iterator of features from vector data provider or vector layer.
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
const QgsVectorLayerJoinInfo * joinInfo
Canonical source of information about the join.
virtual bool close()=0
end of iterating: free the resources / lock
A rectangle specified with double values.
QSet< QgsFeatureId > QgsFeatureIds
virtual QgsFields fields() const =0
Returns the fields associated with features in the source.
QgsFeatureIterator mProviderIterator
QMap< int, QgsExpression * > mExpressionFieldInfo
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
virtual bool rewind()=0
reset the iterator to the starting position
virtual QgsWkbTypes::Type wkbType() const =0
Returns the geometry type for features returned by this source.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
QList< QgsField > mAddedAttributes
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
const QgsCoordinateReferenceSystem & crs
QgsVectorLayer * joinLayer
Resolved pointer to the joined layer.
Manages joined fields for a vector layer.
int joinField
Index of field (of the joined layer) must have equal value.
QgsFeatureRequest mChangedFeaturesRequest
Base class for feedback objects to be used for cancellation of something running in a worker thread...
QgsExpressionContextScope mLayerScope
Type
The WKB type describes the number of dimensions a geometry has.
Internal feature iterator to be implemented within data providers.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Defines left outer join from our vector layer to some other vector layer.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QgsFeatureRequest mProviderRequest
QgsGeometryMap mChangedGeometries
QgsFeatureIds mDeletedFeatureIds
QgsAttributeList mDeletedAttributeIds
Single scope for storing variables and functions for use within a QgsExpressionContext.
Base class that can be used for any class that is capable of returning features.
QSet< QgsFeatureId > mFetchConsidered
virtual QgsCoordinateReferenceSystem sourceCrs() const =0
Returns the coordinate reference system for features in the source.
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
int indexOffset
At what position the joined fields start.
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap
int targetField
Index of field (of this layer) that drives the join.
virtual QgsExpressionContextScope * createExpressionContextScope() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Buffers information about expression fields for a vector layer.
QgsFeatureSource subclass for the selected features from a QgsVectorLayer.
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Abstract interface for generating an expression context scope.
An interface for objects which provide features via a getFeatures method.
QgsFeatureMap mAddedFeatures
QMap< const QgsVectorLayerJoinInfo *, QgsVectorLayerFeatureIterator::FetchJoinInfo > mFetchJoinInfo
Information about joins used in the current select() statement.
This class represents a coordinate reference system (CRS).
Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAtt...
virtual void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped...
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
QgsCoordinateReferenceSystem mCrs
QList< int > QgsAttributeList
bool mHasVirtualAttributes
QgsChangedAttributesMap mChangedAttributeValues
virtual QString sourceName() const =0
Returns a friendly display name for the source.
Represents a vector layer which manages a vector based data sets.
QgsCoordinateTransform mTransform
QgsAttributeList attributes
Attributes to fetch.
bool nextFeatureFilterExpression(QgsFeature &f) override
Overrides default method as we only need to filter features in the edit buffer while for others filte...
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const =0
Returns an iterator for the features in the source.
QgsFeatureIterator mChangedFeaturesIterator
Helper template that cares of two things: 1.
virtual long featureCount() const =0
Returns the number of features contained in the source, or -1 if the feature count is unknown...