#include </home/clem/local/src/opie/qmake/include/qgcache.h>
Inheritance diagram for QGCache:


Protected Types | |
| enum | KeyType { StringKey, AsciiKey, IntKey, PtrKey } |
Protected Member Functions | |
| QGCache (int maxCost, uint size, KeyType kt, bool caseSensitive, bool copyKeys) | |
| QGCache (const QGCache &) | |
| ~QGCache () | |
| QGCache & | operator= (const QGCache &) |
| uint | count () const |
| uint | size () const |
| int | maxCost () const |
| int | totalCost () const |
| void | setMaxCost (int maxCost) |
| void | clear () |
| bool | insert_string (const QString &key, QPtrCollection::Item, int cost, int priority) |
| bool | insert_other (const char *key, QPtrCollection::Item, int cost, int priority) |
| bool | remove_string (const QString &key) |
| bool | remove_other (const char *key) |
| QPtrCollection::Item | take_string (const QString &key) |
| QPtrCollection::Item | take_other (const char *key) |
| QPtrCollection::Item | find_string (const QString &key, bool ref=TRUE) const |
| QPtrCollection::Item | find_other (const char *key, bool ref=TRUE) const |
| void | statistics () const |
Private Member Functions | |
| bool | makeRoomFor (int cost, int priority=-1) |
Private Attributes | |
| KeyType | keytype |
| QCList * | lruList |
| QCDict * | dict |
| int | mCost |
| int | tCost |
| bool | copyk |
Friends | |
| class | QGCacheIterator |
For internal use only.
QGCache is a strictly internal class that acts as a base class for the collection classes QCache and QIntCache.
Definition at line 53 of file qgcache.h.
|
|
|
|
||||||||||||||||||||||||
|
Constructs a cache. The maximum cost of the cache is given by maxCost and the size by size. The key type is kt which may be Definition at line 251 of file qgcache.cpp. References AsciiKey, copyk, dict, FALSE, keytype, lruList, mCost, QCList::setAutoDelete(), tCost, and TRUE. |
|
|
Cannot copy a cache. Definition at line 279 of file qgcache.cpp. References qFatal(). |
|
|
Removes all items from the cache and destroys it. Definition at line 291 of file qgcache.cpp. |
|
|
Clears the cache. Implements QPtrCollection. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 505 of file qgcache.cpp. References AsciiKey, QCacheItem::data, QPtrCollection::deleteItem(), dict, QCList::first(), IntKey, keytype, lruList, PtrKey, QCDict::remove_ascii(), QCDict::remove_int(), QCDict::remove_string(), QCList::removeFirst(), StringKey, and tCost. Referenced by QCache< QFontStruct >::clear(), and ~QGCache(). |
|
|
Returns the number of items in the cache. Implements QPtrCollection. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 315 of file qgcache.cpp. References QGDict::count(), and dict. Referenced by QCache< QFontStruct >::count(), QCache< QFontStruct >::isEmpty(), and statistics(). |
|
||||||||||||
|
Finds an item for key in the cache and adds a reference if ref is TRUE. Definition at line 559 of file qgcache.cpp. References AsciiKey, dict, QCDict::find_ascii(), QCDict::find_int(), keytype, lruList, and QCList::reference(). |
|
||||||||||||
|
Finds an item for key in the cache and adds a reference if ref is TRUE. Definition at line 536 of file qgcache.cpp. References dict, QCDict::find_string(), lruList, and QCList::reference(). Referenced by QCache< QFontStruct >::find(), and QCache< QFontStruct >::operator[](). |
|
||||||||||||||||||||
|
Definition at line 396 of file qgcache.cpp. References AsciiKey, copyk, dict, FALSE, QCList::insert(), QCDict::insert_ascii(), QCDict::insert_int(), keytype, lruList, makeRoomFor(), mCost, QPtrCollection::newItem(), Q_ASSERT, qstrdup(), StringKey, tCost, and TRUE. |
|
||||||||||||||||||||
|
Inserts an item with data data into the cache using key key. The item has cost cost and priority priority.
Definition at line 367 of file qgcache.cpp. References dict, FALSE, QCList::insert(), QCDict::insert_string(), keytype, lruList, makeRoomFor(), mCost, QPtrCollection::newItem(), Q_ASSERT, StringKey, tCost, and TRUE. Referenced by QCache< QFontStruct >::insert(). |
|
||||||||||||
|
Allocates cache space for one or more items. Definition at line 583 of file qgcache.cpp. References AsciiKey, copyk, QCacheItem::cost, QCacheItem::data, QPtrCollection::deleteItem(), dict, FALSE, IntKey, keytype, QCList::last(), lruList, mCost, QCList::prev(), PtrKey, Q_ASSERT, QCDict::remove_ascii(), QCDict::remove_int(), QCDict::remove_string(), QCList::removeLast(), StringKey, tCost, and TRUE. Referenced by insert_other(), insert_string(), and setMaxCost(). |
|
|
Returns the maximum cache cost. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 68 of file qgcache.h. Referenced by QCache< QFontStruct >::maxCost(). |
|
|
Cannot assign a cache. Definition at line 302 of file qgcache.cpp. References qFatal(). Referenced by QCache< QFontStruct >::operator=(). |
|
|
Definition at line 444 of file qgcache.cpp. References d, QPtrCollection::deleteItem(), and take_other(). |
|
|
Removes the item with key key from the cache. Returns TRUE if the item was removed; otherwise returns FALSE. Definition at line 436 of file qgcache.cpp. References d, QPtrCollection::deleteItem(), and take_string(). Referenced by QCache< QFontStruct >::remove(). |
|
|
Sets the maximum cache cost to maxCost. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 345 of file qgcache.cpp. References makeRoomFor(), mCost, and tCost. Referenced by QCache< QFontStruct >::setMaxCost(). |
|
|
Returns the size of the hash array. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 324 of file qgcache.cpp. References dict, and QGDict::size(). Referenced by QCache< QFontStruct >::size(). |
|
|
Outputs debug statistics. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 636 of file qgcache.cpp. References QString::ascii(), count(), dict, QString::fill(), lruList, mCost, qDebug(), QCDict::statistics(), and tCost. Referenced by QCache< QFontStruct >::statistics(). |
|
|
Takes the item with key key out of the cache. The item is not deleted. If no item has this key 0 is returned. Definition at line 479 of file qgcache.cpp. References AsciiKey, copyk, d, dict, keytype, lruList, QCList::take(), QCDict::take_ascii(), QCDict::take_int(), and tCost. Referenced by remove_other(). |
|
|
Takes the item with key key out of the cache. The item is not deleted. If no item has this key 0 is returned. Definition at line 458 of file qgcache.cpp. References d, dict, lruList, QCList::take(), QCDict::take_string(), and tCost. Referenced by remove_string(), and QCache< QFontStruct >::take(). |
|
|
Returns the total cache cost. Reimplemented in QCache< type >, QCache< QPixmap >, QCache< SkinData >, QCache< QImage >, and QCache< QFontStruct >. Definition at line 69 of file qgcache.h. Referenced by QCache< QFontStruct >::totalCost(). |
|
|
|
|
|
Definition at line 94 of file qgcache.h. Referenced by insert_other(), makeRoomFor(), QGCache(), and take_other(). |
|
|
Definition at line 91 of file qgcache.h. Referenced by clear(), count(), find_other(), find_string(), insert_other(), insert_string(), makeRoomFor(), QGCache(), size(), statistics(), take_other(), take_string(), and ~QGCache(). |
|
|
Definition at line 89 of file qgcache.h. Referenced by clear(), find_other(), insert_other(), insert_string(), makeRoomFor(), QGCache(), and take_other(). |
|
|
Definition at line 90 of file qgcache.h. Referenced by clear(), find_other(), find_string(), insert_other(), insert_string(), makeRoomFor(), QGCache(), QGCacheIterator::QGCacheIterator(), statistics(), take_other(), take_string(), and ~QGCache(). |
|
|
Definition at line 92 of file qgcache.h. Referenced by insert_other(), insert_string(), makeRoomFor(), QGCache(), setMaxCost(), and statistics(). |
|
|
Definition at line 93 of file qgcache.h. Referenced by clear(), insert_other(), insert_string(), makeRoomFor(), QGCache(), setMaxCost(), statistics(), take_other(), and take_string(). |
1.4.2