#include <qcache.h>
Public Member Functions | |
QCache (const QCache< type > &c) | |
QCache (int maxCost=100, int size=17, bool caseSensitive=TRUE) | |
~QCache () | |
QCache< type > & | operator= (const QCache< type > &c) |
int | maxCost () const |
int | totalCost () const |
void | setMaxCost (int m) |
uint | count () const |
uint | size () const |
bool | isEmpty () const |
void | clear () |
bool | insert (const char *k, const type *d, int c=1, int p=0) |
bool | remove (const char *k) |
type * | take (const char *k) |
type * | find (const char *k, bool ref=TRUE) const |
type * | operator[] (const char *k) const |
void | statistics () const |
int | hits () const |
int | misses () const |
Public Member Functions inherited from QCollection | |
bool | autoDelete () const |
void | setAutoDelete (bool enable) |
Private Member Functions | |
void | deleteItem (Item d) |
Additional Inherited Members | |
Public Types inherited from QCollection | |
typedef void * | Item |
Protected Types inherited from QGCache | |
enum | KeyType { StringKey, AsciiKey, IntKey, PtrKey } |
Protected Member Functions inherited from QGCache | |
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, QCollection::Item, int cost, int priority) |
bool | insert_other (const char *key, QCollection::Item, int cost, int priority) |
bool | remove_string (const QString &key) |
bool | remove_other (const char *key) |
QCollection::Item | take_string (const QString &key) |
QCollection::Item | take_other (const char *key) |
QCollection::Item | find_string (const QString &key, bool ref=TRUE) const |
QCollection::Item | find_other (const char *key, bool ref=TRUE) const |
void | statistics () const |
int | hits () const |
int | misses () const |
Protected Member Functions inherited from QCollection | |
QCollection () | |
QCollection (const QCollection &) | |
virtual | ~QCollection () |
virtual Item | newItem (Item) |
Protected Attributes inherited from QCollection | |
bool | del_item |
Definition at line 88 of file qcache.h.
|
inline |
Definition at line 89 of file qcache.h.
Removes all objects from the collection. The objects will be deleted if auto-delete has been enabled.
Implements QCollection.
Definition at line 100 of file qcache.h.
Returns the number of objects in the collection.
Implements QCollection.
Definition at line 97 of file qcache.h.
Virtual function that deletes an item that is about to be removed from the collection.
The default implementation deletes d pointer if and only if auto-delete has been enabled.
This function is always reimplemented in the collection template classes.
Reimplemented from QCollection.
Definition at line 115 of file qcache.h.
Definition at line 107 of file qcache.h.
|
inline |
Definition at line 101 of file qcache.h.
Definition at line 92 of file qcache.h.
Definition at line 109 of file qcache.h.
Definition at line 105 of file qcache.h.