2 #ifndef __libquark_util_WriteBackCache_hxx 3 #define __libquark_util_WriteBackCache_hxx 33 void insert(K key, T *value);
96 virtual void write(
const T *value) = 0;
102 Item(K key, T *value)
117 void link(Item *item);
118 void unlink(Item *item);
119 bool iterate(
bool doWrite,
bool doDelete);
122 QHash<K, Item*> _map;
127 #include <quark/WriteBackCacheImpl.h++> 132 #endif // __libquark_util_WriteBackCache_hxx bool flush()
Flushes the cache.
bool isDirty(K key) const
virtual ~WriteBackCache()
Destructor.
void insert(K key, T *value)
Inserts a key/value pair into the cache.
virtual void write(const T *value)=0
Writes a cached value to the cache source.
Definition: BarChartView.h++:6
T * lookup(K key)
Looks up the value for a given key in the cache.
WriteBackCache(int maxCapacity)
Constructs a new WriteBackCache with the given maximum capacity.
An abstract LRU cache implementation that tracks modifications to the cached items and performs write...
Definition: WriteBackCache.h++:21
bool sync()
Synchronizes the cache contents with the cache source.
void setDirty(K key, bool dirty)
Sets the "dirty" flag for the value for a given key in the cache.