45 #define USE_ASCII_STRING 47 #ifndef USE_ASCII_STRING 53 QCache(
int maxCost=100,
int size=17,
bool caseSensitive=TRUE )
54 :
QGCache( maxCost, size, StringKey, caseSensitive, FALSE ) {}
58 int maxCost()
const {
return QGCache::maxCost(); }
59 int totalCost()
const {
return QGCache::totalCost(); }
60 void setMaxCost(
int m ) { QGCache::setMaxCost(m); }
62 uint size()
const {
return QGCache::size(); }
65 bool insert(
const QString &k,
const type *d,
int c=1,
int p=0 )
66 {
return QGCache::insert_string(k,(Item)d,c,p);}
68 {
return QGCache::remove_string(k); }
70 {
return (type *)QGCache::take_string(k); }
71 type *find(
const QString &k,
bool ref=TRUE )
const 72 {
return (type *)QGCache::find_string(k,ref);}
73 type *operator[](
const QString &k )
const 74 {
return (type *)QGCache::find_string(k);}
75 void statistics()
const { QGCache::statistics(); }
76 int hits()
const {
return QGCache::hits(); }
77 int misses()
const {
return QGCache::misses(); }
79 void deleteItem( Item d ) {
if ( del_item )
delete (type *)d; }
89 QCache(
int maxCost=100,
int size=17,
bool caseSensitive=TRUE )
90 :
QGCache( maxCost, size, AsciiKey, caseSensitive, TRUE ) {}
94 int maxCost()
const {
return QGCache::maxCost(); }
95 int totalCost()
const {
return QGCache::totalCost(); }
96 void setMaxCost(
int m ) { QGCache::setMaxCost(m); }
98 uint size()
const {
return QGCache::size(); }
101 bool insert(
const char *k,
const type *d,
int c=1,
int p=0 )
102 {
return QGCache::insert_other(k,(Item)d,c,p);}
103 bool remove(
const char *k )
104 {
return QGCache::remove_other(k); }
105 type *take(
const char *k )
106 {
return (type *)QGCache::take_other(k); }
107 type *find(
const char *k,
bool ref=TRUE )
const 108 {
return (type *)QGCache::find_other(k,ref);}
109 type *operator[](
const char *k )
const 110 {
return (type *)QGCache::find_other(k);}
111 void statistics()
const { QGCache::statistics(); }
112 int hits()
const {
return QGCache::hits(); }
113 int misses()
const {
return QGCache::misses(); }
115 void deleteItem( Item d ) {
if ( del_item )
delete (type *)d; }
131 uint count()
const {
return QGCacheIterator::count(); }
132 bool isEmpty()
const {
return QGCacheIterator::count() == 0; }
133 bool atFirst()
const {
return QGCacheIterator::atFirst(); }
134 bool atLast()
const {
return QGCacheIterator::atLast(); }
135 type *toFirst() {
return (type *)QGCacheIterator::toFirst(); }
136 type *toLast() {
return (type *)QGCacheIterator::toLast(); }
137 operator type *()
const {
return (type *)QGCacheIterator::get(); }
138 type *current()
const {
return (type *)QGCacheIterator::get(); }
139 #ifndef USE_ASCII_STRING 140 QString currentKey()
const{
return QGCacheIterator::getKeyString(); }
142 const char *currentKey()
const{
return QGCacheIterator::getKeyAscii(); }
144 type *operator()() {
return (type *)QGCacheIterator::operator()();}
145 type *operator++() {
return (type *)QGCacheIterator::operator++(); }
146 type *operator+=(uint j) {
return (type *)QGCacheIterator::operator+=(j);}
147 type *operator--() {
return (type *)QGCacheIterator::operator--(); }
148 type *operator-=(uint j) {
return (type *)QGCacheIterator::operator-=(j);}
The QGCache class is an internal class for implementing QCache template classes.
Definition: qgcache.h:53
void clear()
Definition: qcache.h:100
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
An internal class for implementing QCacheIterator and QIntCacheIterator.
Definition: qgcache.h:100
uint count() const
Definition: qgcache.h:66
void clear()
Definition: qgcache.cpp:493
virtual void deleteItem(Item)
Definition: qcollection.cpp:174
uint count() const
Definition: qcache.h:97