![]() |
LeechCraft
0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
|
A thread-safe garbage-collected network disk cache. More...
#include "networkdiskcache.h"
Inheritance diagram for LC::Util::NetworkDiskCache:
Collaboration diagram for LC::Util::NetworkDiskCache:Public Member Functions | |
| NetworkDiskCache (const QString &subpath, QObject *parent=0) | |
| Constructs the new disk cache. More... | |
| qint64 | cacheSize () const override |
| Reimplemented from QNetworkDiskCache. More... | |
| QIODevice * | data (const QUrl &url) override |
| Reimplemented from QNetworkDiskCache. More... | |
| void | insert (QIODevice *device) override |
| Reimplemented from QNetworkDiskCache. More... | |
| QNetworkCacheMetaData | metaData (const QUrl &url) override |
| Reimplemented from QNetworkDiskCache. More... | |
| QIODevice * | prepare (const QNetworkCacheMetaData &) override |
| Reimplemented from QNetworkDiskCache. More... | |
| bool | remove (const QUrl &url) override |
| Reimplemented from QNetworkDiskCache. More... | |
| void | updateMetaData (const QNetworkCacheMetaData &metaData) override |
| Reimplemented from QNetworkDiskCache. More... | |
Protected Member Functions | |
| qint64 | expire () override |
| Reimplemented from QNetworkDiskCache. More... | |
A thread-safe garbage-collected network disk cache.
This class is thread-safe unlike the original QNetworkDiskCache, thus it can be used from multiple threads simultaneously.
Also, old cache data is automatically removed from the cache in a background thread without blocking. The garbage collection can be also triggered manually via the collectGarbage() slot.
The garbage is collected until cache takes 90% of its maximum size.
Definition at line 55 of file networkdiskcache.h.
| LC::Util::NetworkDiskCache::NetworkDiskCache | ( | const QString & | subpath, |
| QObject * | parent = 0 |
||
| ) |
Constructs the new disk cache.
The cache uses a subdirectory subpath in the network directory of the user cache location.
| [in] | subpath | The subpath in cache user location. |
| [in] | parent | The parent object of this cache. |
Definition at line 51 of file networkdiskcache.cpp.
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 61 of file networkdiskcache.cpp.
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 66 of file networkdiskcache.cpp.
|
overrideprotected |
Reimplemented from QNetworkDiskCache.
Definition at line 117 of file networkdiskcache.cpp.
References LC::Util::NetworkDiskCacheGC::Instance().
Here is the call graph for this function:
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 72 of file networkdiskcache.cpp.
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 88 of file networkdiskcache.cpp.
Referenced by updateMetaData().
Here is the caller graph for this function:
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 94 of file networkdiskcache.cpp.
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 103 of file networkdiskcache.cpp.
|
override |
Reimplemented from QNetworkDiskCache.
Definition at line 111 of file networkdiskcache.cpp.
References metaData().
Here is the call graph for this function: