Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QCache< Key, T > Class Template Reference

#include <qcache.h>

+ Collaboration diagram for QCache< Key, T >:

Public Member Functions

 QCache (qsizetype maxCost=100) noexcept
 
 ~QCache ()
 
qsizetype maxCost () const noexcept
 
void setMaxCost (qsizetype m) noexcept(std::is_nothrow_destructible_v< Node >)
 
qsizetype totalCost () const noexcept
 
qsizetype size () const noexcept
 
qsizetype count () const noexcept
 
bool isEmpty () const noexcept
 
QList< Keykeys () const
 
void clear () noexcept(std::is_nothrow_destructible_v< Node >)
 
bool insert (const Key &key, T *object, qsizetype cost=1)
 
T * object (const Key &key) const noexcept
 
T * operator[] (const Key &key) const noexcept
 
bool contains (const Key &key) const noexcept
 
bool remove (const Key &key) noexcept(std::is_nothrow_destructible_v< Node >)
 
T * take (const Key &key) noexcept(std::is_nothrow_destructible_v< Key >)
 

Detailed Description

template<class Key, class T>
class QCache< Key, T >

Definition at line 13 of file qcache.h.

Constructor & Destructor Documentation

◆ QCache()

template<class Key , class T >
QCache< Key, T >::QCache ( qsizetype maxCost = 100)
inlineexplicitnoexcept

Definition at line 141 of file qcache.h.

◆ ~QCache()

template<class Key , class T >
QCache< Key, T >::~QCache ( )
inline

Definition at line 145 of file qcache.h.

References QCache< Key, T >::clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ clear()

template<class Key , class T >
void QCache< Key, T >::clear ( )
inlinenoexcept

Definition at line 176 of file qcache.h.

References d.

Referenced by QCache< Key, T >::~QCache(), QPMCache::clear(), QQmlTypeLoader::clearCache(), and QOpenGLTextureCache::invalidateResource().

+ Here is the caller graph for this function:

◆ contains()

template<class Key , class T >
bool QCache< Key, T >::contains ( const Key & key) const
inlinenoexcept

Definition at line 217 of file qcache.h.

References d, and QCache< Key, T >::isEmpty().

Referenced by QQmlTypeLoader::absoluteFilePath(), QQmlTypeLoader::directoryExists(), QQmlTypeLoader::fileExists(), and QGtk3Storage::standardPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ count()

template<class Key , class T >
qsizetype QCache< Key, T >::count ( ) const
inlinenoexcept

Definition at line 162 of file qcache.h.

References d.

◆ insert()

template<class Key , class T >
bool QCache< Key, T >::insert ( const Key & key,
T * object,
qsizetype cost = 1 )
inline

Definition at line 184 of file qcache.h.

References cost(), d, and QCache< Key, T >::remove().

Referenced by QQmlTypeLoader::absoluteFilePath(), QXcbCursor::changeCursor(), QQmlTypeLoader::directoryExists(), QQmlTypeLoader::fileExists(), QPMCache::insert(), QOpenGLProgramBinaryCache::load(), and QGtk3Storage::standardPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEmpty()

template<class Key , class T >
bool QCache< Key, T >::isEmpty ( ) const
inlinenoexcept

Definition at line 163 of file qcache.h.

References d.

Referenced by QCache< Key, T >::contains(), QCache< Key, T >::remove(), and QCache< Key, T >::take().

+ Here is the caller graph for this function:

◆ keys()

template<class Key , class T >
QList< Key > QCache< Key, T >::keys ( ) const
inline

Definition at line 164 of file qcache.h.

References d, it, Q_ASSERT, and QCache< Key, T >::size().

Referenced by QPMCache::clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maxCost()

template<class Key , class T >
qsizetype QCache< Key, T >::maxCost ( ) const
inlinenoexcept

Definition at line 153 of file qcache.h.

◆ object()

template<class Key , class T >
T * QCache< Key, T >::object ( const Key & key) const
inlinenoexcept

Definition at line 209 of file qcache.h.

Referenced by QQmlTypeLoader::absoluteFilePath(), QOpenGLTextureCache::bindTexture(), QOpenGLTextureCache::bindTexture(), QXcbCursor::changeCursor(), QQmlTypeLoader::directoryExists(), QQmlTypeLoader::fileExists(), QOpenGLProgramBinaryCache::load(), QPMCache::object(), and QGtk3Storage::standardPixmap().

+ Here is the caller graph for this function:

◆ operator[]()

template<class Key , class T >
T * QCache< Key, T >::operator[] ( const Key & key) const
inlinenoexcept

Definition at line 213 of file qcache.h.

◆ remove()

template<class Key , class T >
bool QCache< Key, T >::remove ( const Key & key)
inlinenoexcept

Definition at line 222 of file qcache.h.

References d, and QCache< Key, T >::isEmpty().

Referenced by QCache< Key, T >::insert(), QOpenGLTextureCache::invalidate(), and QPMCache::remove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMaxCost()

template<class Key , class T >
void QCache< Key, T >::setMaxCost ( qsizetype m)
inlinenoexcept

Definition at line 154 of file qcache.h.

Referenced by QXcbCursor::QXcbCursor().

+ Here is the caller graph for this function:

◆ size()

template<class Key , class T >
qsizetype QCache< Key, T >::size ( ) const
inlinenoexcept

Definition at line 161 of file qcache.h.

References d.

Referenced by QCache< Key, T >::keys().

+ Here is the caller graph for this function:

◆ take()

template<class Key , class T >
T * QCache< Key, T >::take ( const Key & key)
inlinenoexcept

Definition at line 235 of file qcache.h.

References d, and QCache< Key, T >::isEmpty().

+ Here is the call graph for this function:

◆ totalCost()

template<class Key , class T >
qsizetype QCache< Key, T >::totalCost ( ) const
inlinenoexcept

Definition at line 159 of file qcache.h.


The documentation for this class was generated from the following file: