19 #ifndef QgsVectorLayerCache_H
20 #define QgsVectorLayerCache_H
67 mCache->featureRemoved( mFeature->id() );
229 void progress(
int i,
bool& cancel );
273 mCache.insert( feat.
id(), cachedFeature );
277 QCache< QgsFeatureId, QgsCachedFeature >
mCache;
289 #endif // QgsVectorLayerCache_H
QgsFeatureId id() const
Get the feature id for this feature.
Wrapper for iterator of features from vector data provider or vector layer.
QList< QgsAbstractCacheIndex * > mCacheIndices
QgsAttributeList mCachedAttributes
QSet< QgsFeatureId > QgsFeatureIds
bool removeCachedFeature(QgsFeatureId fid)
Removes the feature identified by fid from the cache if present.
bool isFidCached(const QgsFeatureId fid)
Check if a certain feature id is cached.
QgsVectorLayer * layer()
Returns the layer to which this cache belongs.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QCache< QgsFeatureId, QgsCachedFeature > mCache
void setCacheSubsetOfAttributes(const QgsAttributeList &attributes)
Set the subset of attributes to be cached.
const QgsFeature * feature()
void featureAdded(QgsFeatureId fid)
Is emitted, when a new feature has been added to the layer and this cache.
void attributeAdded(int field)
Uses another iterator as backend and writes features to the cache.
QgsVectorLayerCache * mCache
void progress(int i, bool &cancel)
When filling the cache, this signal gets emitted periodically to notify about the progress and to be ...
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
void featureDeleted(QgsFeatureId fid)
void cachedLayerDeleted()
Is emitted when the cached layer is deleted.
QgsCachedFeature(const QgsFeature &feat, QgsVectorLayerCache *vlCache)
Will create a new cached feature.
void geometryChanged(QgsFeatureId fid, QgsGeometry &geom)
bool checkInformationCovered(const QgsFeatureRequest &featureRequest)
Checks if the information required to complete the request is cached.
This class caches features of a given QgsVectorLayer.
void attributeValueChanged(const QgsFeatureId &fid, const int &field, const QVariant &value)
Is emitted when an attribute is changed.
Abstract base class for cache indices.
void setCacheGeometry(bool cacheGeometry)
Enable or disable the caching of geometries.
void setFullCache(bool fullCache)
This enables or disables full caching.
bool featureAtId(QgsFeatureId featureId, QgsFeature &feature, bool skipCache=false)
Gets the feature at the given feature id.
void cacheFeature(QgsFeature &feat)
void setCacheSize(int cacheSize)
Sets the maximum number of features to keep in the cache.
void requestCompleted(QgsFeatureRequest featureRequest, QgsFeatureIds fids)
Gets called, whenever the full list of feature ids for a certain request is known.
This is a wrapper class around a cached QgsFeature, which will inform the cache, when it has been del...
QgsVectorLayerCache(QgsVectorLayer *layer, int cacheSize, QObject *parent=NULL)
Delivers features from the cache.
void featureRemoved(QgsFeatureId fid)
Gets called, whenever a feature has been removed.
int cacheSize()
Returns the maximum number of features this cache will hold.
void onAttributeValueChanged(QgsFeatureId fid, int field, const QVariant &value)
friend class QgsCachedFeature
void addCacheIndex(QgsAbstractCacheIndex *cacheIndex)
Adds a QgsAbstractCacheIndex to this cache.
Represents a vector layer which manages a vector based data sets.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &featureRequest=QgsFeatureRequest())
Query this VectorLayerCache for features.
void finished()
When filling the cache, this signal gets emitted once the cache is fully initialized.
void onFeatureAdded(QgsFeatureId fid)
void setCacheAddedAttributes(bool cacheAddedAttributes)
If this is enabled, the subset of cached attributes will automatically be extended to also include ne...
void attributeDeleted(int field)