Kstars
9static int qHash(
const pixCacheKey_t &key, uint seed)
11 return qHash(
QString(
"%1_%2_%3").arg(key.level).
arg(key.pix).
arg(key.uid), seed);
14inline bool operator<(
const pixCacheKey_t &k1,
const pixCacheKey_t &k2)
18 return k1.uid < k2.uid;
21 if (k1.level != k2.level)
23 return k1.level < k2.level;
26 return k1.pix < k2.pix;
29inline bool operator==(
const pixCacheKey_t &k1,
const pixCacheKey_t &k2)
31 return (k1.uid == k2.uid) && (k1.level == k2.level) && (k1.pix == k2.pix);
34void PixCache::add(pixCacheKey_t &key, pixCacheItem_t *item,
int cost)
36 Q_ASSERT(cost < m_cache.maxCost());
38 m_cache.insert(key, item, cost);
41pixCacheItem_t *PixCache::get(pixCacheKey_t &key)
43 return m_cache.object(key);
46void PixCache::setMaxCost(
int maxCost)
48 m_cache.setMaxCost(maxCost);
51void PixCache::printCache()
53 qDebug() << Q_FUNC_INFO <<
" -- cache ---------------";
54 qDebug() << Q_FUNC_INFO << m_cache.size() << m_cache.totalCost() << m_cache.maxCost();
59 return m_cache.totalCost();
QString arg(Args &&... args) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:01 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.