A feature pool is based on a vector layer and caches features. More...
#include <qgsfeaturepool.h>
A feature pool is based on a vector layer and caches features.
Definition at line 37 of file qgsfeaturepool.h.
Creates a new feature pool for layer.
Definition at line 31 of file qgsfeaturepool.cpp.
Returns the complete set of feature ids in this pool.
Note that this concerns the features governed by this pool, which are not necessarily all cached.
Definition at line 97 of file qgsfeaturepool.cpp.
The coordinate reference system of this layer.
Definition at line 171 of file qgsfeaturepool.cpp.
Removes a feature from this pool.
Implementations will remove the feature from the layer or from the data provider.
Implemented in QgsVectorLayerFeaturePool, and QgsVectorDataProviderFeaturePool.
The geometry type of this layer.
Definition at line 177 of file qgsfeaturepool.cpp.
Retrieves the feature with the specified id into feature.
It will be retrieved from the cache or from the underlying feature source if unavailable. If the feature is neither available from the cache nor from the source it will return
false.
Definition at line 41 of file qgsfeaturepool.cpp.
Gets features for the provided request.
No features will be fetched from the cache and the request is sent directly to the underlying feature source. Results of the request are cached in the pool and the ids of all the features are returned. This is used to warm the cache for a particular area of interest (bounding box) or other set of features. This will get a new feature source from the source vector layer. This needs to be called from the main thread. If feedback is specified, the call may return if the feedback is canceled.
Definition at line 73 of file qgsfeaturepool.cpp.
Gets all feature ids in the bounding box rect.
It will use a spatial index to determine the ids.
Definition at line 102 of file qgsfeaturepool.cpp.
Inserts a feature into the cache and the spatial index.
To be used by implementations of
addFeature.
Definition at line 121 of file qgsfeaturepool.cpp.
Checks if the feature fid is cached.
Definition at line 160 of file qgsfeaturepool.cpp.
Gets a pointer to the underlying layer.
May return a
\c nullptr if the layer has been deleted. This must only be called from the main thread.
Definition at line 109 of file qgsfeaturepool.cpp.
The layer id of the layer.
Definition at line 182 of file qgsfeaturepool.cpp.
Returns the name of the layer.
Should be preferred over layer().name() because it can directly be run on the background thread.
Definition at line 166 of file qgsfeaturepool.cpp.
Gets a QPointer to the underlying layer.
Note that access to any methods of the object will need to be done on the main thread and the pointer will need to be checked for validity before usage.
Definition at line 116 of file qgsfeaturepool.cpp.
Changes a feature in the cache and the spatial index.
To be used by implementations of
updateFeature.
Definition at line 131 of file qgsfeaturepool.cpp.
Removes a feature from the cache and the spatial index.
To be used by implementations of
deleteFeature.
Definition at line 142 of file qgsfeaturepool.cpp.
Sets all the feature ids governed by this feature pool.
Should be called by subclasses constructor and whenever they insert a new feature.
Definition at line 155 of file qgsfeaturepool.cpp.
Updates a feature in this pool.
Implementations will update the feature on the layer or on the data provider.
Implemented in QgsVectorLayerFeaturePool, and QgsVectorDataProviderFeaturePool.