Public Member Functions | Public Attributes | Friends | List of all members
QCList Class Reference
Inheritance diagram for QCList:
QInternalList< QCacheItem >

Public Member Functions

 QCList ()
 
 ~QCList ()
 
void insert (QCacheItem *)
 
void insert (int, QCacheItem *)
 
void take (QCacheItem *)
 
void reference (QCacheItem *)
 
void setAutoDelete (bool del)
 
bool removeFirst ()
 
bool removeLast ()
 
QCacheItemfirst ()
 
QCacheItemlast ()
 
QCacheItemprev ()
 
QCacheItemnext ()
 

Public Attributes

int inserts
 
int insertCosts
 
int insertMisses
 
int finds
 
int hits
 
int hitCosts
 
int dumps
 
int dumpCosts
 

Friends

class QGCacheIterator
 
class QCListIt
 

Additional Inherited Members

- Private Types inherited from QCollection
typedef void * Item
 
- Private Member Functions inherited from QInternalList< QCacheItem >
 QInternalList ()
 
 QInternalList (const QInternalList< QCacheItem > &l)
 
 ~QInternalList ()
 
QInternalList< QCacheItem > & operator= (const QInternalList< QCacheItem > &l)
 
bool operator== (const QInternalList< QCacheItem > &list) const
 
uint count () const
 
bool isEmpty () const
 
bool insert (uint i, const QCacheItem *d)
 
void inSort (const QCacheItem *d)
 
void prepend (const QCacheItem *d)
 
void append (const QCacheItem *d)
 
bool remove (uint i)
 
bool remove ()
 
bool remove (const QCacheItem *d)
 
bool removeRef (const QCacheItem *d)
 
void removeNode (QLNode *n)
 
bool removeFirst ()
 
bool removeLast ()
 
QCacheItemtake (uint i)
 
QCacheItemtake ()
 
QCacheItemtakeNode (QLNode *n)
 
void clear ()
 
void sort ()
 
int find (const QCacheItem *d)
 
int findNext (const QCacheItem *d)
 
int findRef (const QCacheItem *d)
 
int findNextRef (const QCacheItem *d)
 
uint contains (const QCacheItem *d) const
 
uint containsRef (const QCacheItem *d) const
 
QCacheItemat (uint i)
 
int at () const
 
QCacheItemcurrent () const
 
QLNodecurrentNode () const
 
QCacheItemgetFirst () const
 
QCacheItemgetLast () const
 
QCacheItemfirst ()
 
QCacheItemlast ()
 
QCacheItemnext ()
 
QCacheItemprev ()
 
void toVector (QGVector *vec) const
 
- Private Member Functions inherited from QGList
QDataStreamread (QDataStream &)
 
QDataStreamwrite (QDataStream &) const
 
 QGList ()
 
 QGList (const QGList &)
 
virtual ~QGList ()
 
QGListoperator= (const QGList &)
 
bool operator== (const QGList &) const
 
void inSort (QCollection::Item)
 
void append (QCollection::Item)
 
bool insertAt (uint index, QCollection::Item)
 
void relinkNode (QLNode *)
 
bool removeNode (QLNode *)
 
bool remove (QCollection::Item=0)
 
bool removeRef (QCollection::Item=0)
 
bool removeFirst ()
 
bool removeLast ()
 
bool removeAt (uint index)
 
QCollection::Item takeNode (QLNode *)
 
QCollection::Item take ()
 
QCollection::Item takeAt (uint index)
 
QCollection::Item takeFirst ()
 
QCollection::Item takeLast ()
 
void sort ()
 
int findRef (QCollection::Item, bool=TRUE)
 
int find (QCollection::Item, bool=TRUE)
 
uint containsRef (QCollection::Item) const
 
uint contains (QCollection::Item) const
 
QCollection::Item at (uint index)
 
int at () const
 
QLNodecurrentNode () const
 
QCollection::Item get () const
 
QCollection::Item cfirst () const
 
QCollection::Item clast () const
 
QCollection::Item first ()
 
QCollection::Item last ()
 
QCollection::Item next ()
 
QCollection::Item prev ()
 
void toVector (QGVector *) const
 
virtual int compareItems (QCollection::Item, QCollection::Item)
 
virtual QDataStreamread (QDataStream &, QCollection::Item &)
 
virtual QDataStreamwrite (QDataStream &, QCollection::Item) const
 
- Private Member Functions inherited from QCollection
bool autoDelete () const
 
void setAutoDelete (bool enable)
 
 QCollection ()
 
 QCollection (const QCollection &)
 
virtual ~QCollection ()
 
virtual Item newItem (Item)
 
- Private Attributes inherited from QCollection
bool del_item
 

Detailed Description

Definition at line 76 of file qgcache.cpp.

Constructor & Destructor Documentation

QCList::QCList ( )
inline

Definition at line 81 of file qgcache.cpp.

81 {}
QCList::~QCList ( )

Definition at line 112 of file qgcache.cpp.

113 {
114 #if defined(DEBUG)
115  ASSERT( count() == 0 );
116 #endif
117 }
#define ASSERT(x)
Definition: qglobal.h:590

Member Function Documentation

QCacheItem* QCList::first ( )
inline

Definition at line 94 of file qgcache.cpp.

void QCList::insert ( QCacheItem ci)

Definition at line 120 of file qgcache.cpp.

121 {
122  QCacheItem *item = first();
123  while( item && item->skipPriority > ci->priority ) {
124  item->skipPriority--;
125  item = next();
126  }
127  if ( item )
129  else
130  append( ci );
131 #if defined(DEBUG)
132  ASSERT( ci->node == 0 );
133 #endif
134  ci->node = currentNode();
135 }
QCacheItem * next()
Definition: qgcache.cpp:97
QCacheItem * first()
Definition: qgcache.cpp:94
QLNode * currentNode() const
Definition: qinternallist.h:84
short priority
Definition: qgcache.cpp:63
bool insert(uint i, const type *d)
Definition: qinternallist.h:58
short skipPriority
Definition: qgcache.cpp:64
void append(const QCacheItem *d)
Definition: qinternallist.h:61
QLNode * node
Definition: qgcache.cpp:68
#define ASSERT(x)
Definition: qglobal.h:590
void QCList::insert ( int  i,
QCacheItem ci 
)
inline

Definition at line 137 of file qgcache.cpp.

138 {
140 #if defined(DEBUG)
141  ASSERT( ci->node == 0 );
142 #endif
143  ci->node = currentNode();
144 }
QLNode * currentNode() const
Definition: qinternallist.h:84
bool insert(uint i, const type *d)
Definition: qinternallist.h:58
QLNode * node
Definition: qgcache.cpp:68
#define ASSERT(x)
Definition: qglobal.h:590
QCacheItem* QCList::last ( )
inline

Definition at line 95 of file qgcache.cpp.

QCacheItem* QCList::next ( )
inline

Definition at line 97 of file qgcache.cpp.

QCacheItem* QCList::prev ( )
inline

Definition at line 96 of file qgcache.cpp.

void QCList::reference ( QCacheItem ci)
inline

Definition at line 159 of file qgcache.cpp.

160 {
161 #if defined(DEBUG)
162  ASSERT( ci != 0 && ci->node != 0 );
163 #endif
164  ci->skipPriority = ci->priority;
165  relinkNode( ci->node ); // relink as first item
166 }
short priority
Definition: qgcache.cpp:63
short skipPriority
Definition: qgcache.cpp:64
QLNode * node
Definition: qgcache.cpp:68
void relinkNode(QLNode *)
Definition: qglist.cpp:414
#define ASSERT(x)
Definition: qglobal.h:590
bool QCList::removeFirst ( )
inline

Definition at line 91 of file qgcache.cpp.

bool QCList::removeLast ( )
inline

Definition at line 92 of file qgcache.cpp.

void QCList::setAutoDelete ( bool  del)
inline

Definition at line 89 of file qgcache.cpp.

void setAutoDelete(bool enable)
Definition: qcollection.h:55
void QCList::take ( QCacheItem ci)

Definition at line 147 of file qgcache.cpp.

148 {
149  if ( ci ) {
150 #if defined(DEBUG)
151  ASSERT( ci->node != 0 );
152 #endif
153  takeNode( ci->node );
154  ci->node = 0;
155  }
156 }
QLNode * node
Definition: qgcache.cpp:68
QCacheItem * takeNode(QLNode *n)
Definition: qinternallist.h:71
#define ASSERT(x)
Definition: qglobal.h:590

Friends And Related Function Documentation

friend class QCListIt
friend

Definition at line 79 of file qgcache.cpp.

friend class QGCacheIterator
friend

Definition at line 78 of file qgcache.cpp.

Member Data Documentation

int QCList::dumpCosts

Definition at line 107 of file qgcache.cpp.

int QCList::dumps

Definition at line 106 of file qgcache.cpp.

int QCList::finds

Definition at line 103 of file qgcache.cpp.

int QCList::hitCosts

Definition at line 105 of file qgcache.cpp.

int QCList::hits

Definition at line 104 of file qgcache.cpp.

int QCList::insertCosts

Definition at line 101 of file qgcache.cpp.

int QCList::insertMisses

Definition at line 102 of file qgcache.cpp.

int QCList::inserts

Definition at line 100 of file qgcache.cpp.


The documentation for this class was generated from the following file: