134 ci->
node = currentNode();
143 ci->
node = currentNode();
153 takeNode( ci->
node );
165 relinkNode( ci->
node );
240 lruList->setAutoDelete(
TRUE );
241 copyk = ((keytype == AsciiKey) && copyKeys);
242 dict =
new QCDict( size, kt, caseSensitive,
FALSE );
247 lruList->inserts = 0;
248 lruList->insertCosts = 0;
249 lruList->insertMisses = 0;
252 lruList->hitCosts = 0;
254 lruList->dumpCosts = 0;
266 #if defined(CHECK_NULL) 267 qFatal(
"QGCache::QGCache(QGCache &): Cannot copy a cache" );
290 #if defined(CHECK_NULL) 291 qFatal(
"QGCache::operator=: Cannot copy a cache" );
328 if ( maxCost <
tCost ) {
349 int cost,
int priority)
364 if ( priority < -32768 )
366 else if ( priority > 32767 )
369 cost, (
short)priority );
381 int cost,
int priority)
398 if ( priority < -32768 )
400 else if ( priority > 32767 )
479 delete [] (
char *)ci->
key;
505 delete [] (
char*)ci->
key;
578 if ( priority == -1 )
583 while ( cntCost < cost && ci && ci->skipPriority <= priority ) {
588 if ( cntCost < cost )
607 delete [] (
char *)ci->
key;
632 line.
fill(
'*', 80 );
634 qDebug(
"CACHE STATISTICS:" );
635 qDebug(
"cache contains %d item%s, with a total cost of %d",
637 qDebug(
"maximum cost is %d, cache is %d%% full.",
639 qDebug(
"find() has been called %d time%s",
641 qDebug(
"%d of these were hits, items found had a total cost of %d.",
643 qDebug(
"%d item%s %s been inserted with a total cost of %d.",
646 qDebug(
"%d item%s %s too large or had too low priority to be inserted.",
649 qDebug(
"%d item%s %s been thrown away with a total cost of %d.",
652 qDebug(
"Statistics from internal dictionary class:" );
746 return it->atFirst();
767 return item ? item->
data : 0;
778 return item ? item->
data : 0;
789 return item ? item->
data : 0;
811 return item ? (
const char *)item->
key : 0;
822 return item ? (intptr_t)item->
key : 0;
833 return item ? item->
data : 0;
844 return item ? item->
data : 0;
855 return item ? item->
data : 0;
866 return item ? item->
data : 0;
877 return item ? item->
data : 0;
bool remove_ascii(QCacheItem *item)
bool insert_string(const QString &key, const QCacheItem *ci)
intptr_t getKeyInt() const
QCListIt(const QCListIt *p)
void qDebug(const char *msg,...)
virtual Item newItem(Item)
bool insert_int(long key, const QCacheItem *ci)
void insert(QCacheItem *)
The QGCache class is an internal class for implementing QCache template classes.
def dumps(spectra, indent=4)
QCollection::Item operator-=(uint)
void reference(QCacheItem *)
QCacheItem * find_string(const QString &key) const
QCollection::Item find_string(const QString &key, bool ref=TRUE) const
QGCacheIterator(const QGCache &)
QGCacheIterator & operator=(const QGCacheIterator &)
QGCache(int maxCost, uint size, KeyType kt, bool caseSensitive, bool copyKeys)
bool makeRoomFor(int cost, int priority=-1)
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
bool remove_string(QCacheItem *item)
QCollection::Item take_string(const QString &key)
QCollection::Item look_int(long key, QCollection::Item, int)
QGCache & operator=(const QGCache &)
QCollection::Item toFirst()
QCollection::Item look_ascii(const char *key, QCollection::Item, int)
bool insert_ascii(const char *key, const QCacheItem *ci)
void fill(QChar c, int len=-1)
void setMaxCost(int maxCost)
QCacheItem(void *k, QCollection::Item d, int c, short p)
bool insert_string(const QString &key, QCollection::Item, int cost, int priority)
An internal class for implementing QCacheIterator and QIntCacheIterator.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
bool remove_other(const char *key)
QCollection::Item operator+=(uint)
const char * ascii() const
QCollection::Item operator++()
bool remove_string(const QString &key, QCollection::Item item=0)
bool insert(uint i, const type *d)
QCollection::Item take_ascii(const char *key)
QCacheItem * find_ascii(const char *key) const
The QCollection class is the base class of all Qt collections.
QCDict(uint size, uint kt, bool caseSensitive, bool copyKeys)
QCollection::Item find_other(const char *key, bool ref=TRUE) const
bool remove_ascii(const char *key, QCollection::Item item=0)
bool remove_string(const QString &key)
const char * getKeyAscii() const
bool remove_int(QCacheItem *item)
QCollection::Item take_string(const QString &key)
QCollection::Item take_other(const char *key)
QCacheItem * find_int(long key) const
QCacheItem * take_int(long key)
void setAutoDelete(bool enable)
The QGDict class is an internal class for implementing QDict template classes.
QCollection::Item operator--()
bool remove_int(long key, QCollection::Item item=0)
QCollection::Item operator()()
bool insert_other(const char *key, QCollection::Item, int cost, int priority)
void line(double t, double *p, double &x, double &y, double &z)
QCacheItem * take_string(const QString &key)
QCacheItem * take_ascii(const char *key)
char * qstrdup(const char *str)
QCollection::Item get() const
QCollection::Item take_int(long key)
virtual void deleteItem(Item)
void qFatal(const char *msg,...)
QCollection::Item toLast()
void setAutoDelete(bool del)
The QLNode class is an internal class for the QList template collection.
QCListIt(const QCList *p)
QString getKeyString() const
QCollection::Item look_string(const QString &key, QCollection::Item, int)