Remoto - VFS
|
A subclass of QCache and QObject. More...
#include <VFS_datastore.h>
Public Member Functions | |
VFS_datastore_cache (quint64 size) | |
virtual | ~VFS_datastore_cache () |
bool | insert (const QString &key, VFS_datastore_cache_entry *object) |
Insert a new entry. More... | |
Static Public Attributes | |
static const quint64 | DEFAULT_DATACACHE_SIZE = 104857600 |
The default size to create a cache. Defaults to 100mb. More... | |
Private Slots | |
void | expired (VFS_datastore_cache_entry *) |
A cache entry has exipred. More... | |
void | touched () |
A cache entry has been touched. More... | |
A subclass of QCache and QObject.
The QCache uses QString as a key, and will track VFS_datastore_cache_entry objects.
If the contents of the cache exceed the allowed size, oldest entries will be flushed and removed. Entries will have an expiration and if unmodified, will be flushed and removed from the cache.
Definition at line 60 of file VFS_datastore.h.
|
explicit |
size | The initial size of the cache, in bytes. |
Definition at line 241 of file VFS_datastore.cpp.
|
virtual |
Definition at line 246 of file VFS_datastore.cpp.
|
privateslot |
A cache entry has exipred.
Remove it.
e | The cache entry |
If the entry was not found, write a warning to the log.
Definition at line 317 of file VFS_datastore.cpp.
bool VFS_datastore_cache::insert | ( | const QString & | key, |
VFS_datastore_cache_entry * | object | ||
) |
Insert a new entry.
key | Entry key |
object | Entry object |
This will also connect the expired() signal, allowing the cache to maintain expiration features.
If the insertion is unsuccessful, the result is undefined. The object is not deleted, but the owning VFS_node will need to decide what to do.
Definition at line 289 of file VFS_datastore.cpp.
|
privateslot |
A cache entry has been touched.
Make sure the cache knows.
This will use the object() method to refresh the entry's access time.
Definition at line 334 of file VFS_datastore.cpp.
|
static |
The default size to create a cache. Defaults to 100mb.
Definition at line 74 of file VFS_datastore.h.