Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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.

Member Function Documentation

◆ clear()

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

Definition at line 176 of file qcache.h.

◆ contains()

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

Definition at line 217 of file qcache.h.

◆ count()

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

Definition at line 162 of file qcache.h.

◆ 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.

◆ isEmpty()

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

Definition at line 163 of file qcache.h.

◆ keys()

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

Definition at line 164 of file qcache.h.

◆ 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.

◆ 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.

◆ setMaxCost()

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

Definition at line 154 of file qcache.h.

◆ size()

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

Definition at line 161 of file qcache.h.

◆ take()

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

Definition at line 235 of file qcache.h.

◆ 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: