Krita Source Code Documentation
Loading...
Searching...
No Matches
KoResourceCacheInterface.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KORESOURCECACHEINTERFACE_H
8#define KORESOURCECACHEINTERFACE_H
9
10#include "kritaresources_export.h"
11
12#include <QSharedPointer>
13
14class QString;
15class QVariant;
16
17
70class KRITARESOURCES_EXPORT KoResourceCacheInterface
71{
72public:
74
76 virtual QVariant fetch(const QString &key) const = 0;
77
83 virtual void put(const QString &key, const QVariant &value) = 0;
84
91 using RelatedResourceCookie = std::uintptr_t;
92
98 void setRelatedResourceCookie(RelatedResourceCookie cookie);
99
105 RelatedResourceCookie relatedResourceCookie() const;
106
107private:
109};
110
112
114
115#endif // KORESOURCECACHEINTERFACE_H
float value(const T *src, size_t ch)
a provider-like interface class for sharing caches between multiple resources
virtual QVariant fetch(const QString &key) const =0
fetch a cached object from the cache using key
virtual void put(const QString &key, const QVariant &value)=0
Q_DECLARE_METATYPE(KisPaintopLodLimitations)