GenericDataCache Class
template <typename T> class QInstaller::GenericDataCacheThe GenericDataCache is a template class for a checksum based storage of items on disk. More...
Header: | #include <GenericDataCache> |
Inherited By: |
Public Functions
GenericDataCache() | |
GenericDataCache(const QString &path, const QString &type, const QString &version) | |
virtual | ~GenericDataCache() |
Detailed Description
GenericDataCache<T> manages a cache storage for a set path(), which contains a subdirectory for each registered item. An item of type T
should implement methods declared in the CacheableItem interface. The GenericDataCache<T> class can still be explicitly specialized to use the derived type as a template argument, to allow retrieving items as the derived type without casting.
Each cache has a manifest file in its root directory, which lists the version and wrapped type of the cache, and all its items. The file is updated automatically when the cache object is destructed, or it can be updated periodically by calling sync().
Member Function Documentation
GenericDataCache::GenericDataCache()
Constructs a new empty cache. The cache is invalid until set with a path and initialized.
[explicit]
GenericDataCache::GenericDataCache(const QString &path, const QString &type, const QString &version)
Constructs a cache to path with the given type and version. The cache is initialized automatically.
[virtual]
GenericDataCache::~GenericDataCache()
Deletes the cache object. Item contents on disk are kept.