KDECore
Go to the documentation of this file.
27 #include <QtCore/QString>
28 #include <QtCore/QByteArray>
29 #include <QtCore/QCache>
31 class KSharedDataCache::Private
35 QCache<QString, QByteArray> cache;
39 unsigned defaultCacheSize,
40 unsigned expectedItemSize)
43 d->cache.setMaxCost(defaultCacheSize);
46 Q_UNUSED(expectedItemSize);
56 return d->evictionPolicy;
61 d->evictionPolicy = newPolicy;
66 return d->cache.insert(key,
new QByteArray(data));
71 QByteArray *value = d->cache.object(key);
94 return d->cache.contains(key);
99 return static_cast<unsigned>(d->cache.maxCost());
104 if (d->cache.totalCost() < d->cache.maxCost()) {
105 return static_cast<unsigned>(d->cache.maxCost() - d->cache.totalCost());
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 21:52:42 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.