|
Krita Source Code Documentation
|
#include <KoResourceCachePrefixedStorageWrapper.h>
Inheritance diagram for KoResourceCachePrefixedStorageWrapper:Public Member Functions | |
| QVariant | fetch (const QString &key) const override |
fetch a cached object from the cache using key | |
| KoResourceCachePrefixedStorageWrapper (const QString &prefix, KoResourceCacheInterfaceSP baseInterface) | |
| void | put (const QString &key, const QVariant &value) override |
Public Member Functions inherited from KoResourceCacheInterface | |
| RelatedResourceCookie | relatedResourceCookie () const |
| void | setRelatedResourceCookie (RelatedResourceCookie cookie) |
| virtual | ~KoResourceCacheInterface () |
Private Attributes | |
| KoResourceCacheInterfaceSP | m_baseInterface |
| QString | m_prefix |
Additional Inherited Members | |
Public Types inherited from KoResourceCacheInterface | |
| using | RelatedResourceCookie = std::uintptr_t |
A simple wrapper class that converts all the passed cache keys into a prefixed notation: "key" -> "prefix/key".
This wrapper is usually needed when handing embedded objects using the same cache storage, e.g. masking brush preset, which is stored inside a normal preset under a prefix ("MaskingBrush/Preset/")
Definition at line 21 of file KoResourceCachePrefixedStorageWrapper.h.
| KoResourceCachePrefixedStorageWrapper::KoResourceCachePrefixedStorageWrapper | ( | const QString & | prefix, |
| KoResourceCacheInterfaceSP | baseInterface ) |
Definition at line 11 of file KoResourceCachePrefixedStorageWrapper.cpp.
|
overridevirtual |
fetch a cached object from the cache using key
Implements KoResourceCacheInterface.
Definition at line 17 of file KoResourceCachePrefixedStorageWrapper.cpp.
References m_baseInterface, and m_prefix.
|
overridevirtual |
store a cached object value into the cache using key WARNING: storing an object twice with the same key is considered as invalid operation and will assert! This behavior is intentional to avoid cache key aliasing.
Implements KoResourceCacheInterface.
Definition at line 22 of file KoResourceCachePrefixedStorageWrapper.cpp.
References m_baseInterface, m_prefix, and value().
|
private |
Definition at line 31 of file KoResourceCachePrefixedStorageWrapper.h.
|
private |
Definition at line 30 of file KoResourceCachePrefixedStorageWrapper.h.