22 int QgsChunkList::trueCount()
const 25 QgsChunkListEntry *entry = mHead;
34 void QgsChunkList::insertEntry( QgsChunkListEntry *entry, QgsChunkListEntry *next )
38 Q_ASSERT( next ==
nullptr );
39 mTail = mHead = entry;
44 if ( next ==
nullptr )
52 entry->prev = next->prev;
61 void QgsChunkList::takeEntry( QgsChunkListEntry *entry )
65 if ( !entry->prev && !entry->next )
68 Q_ASSERT( mHead == entry && mTail == entry );
69 mHead = mTail =
nullptr;
71 else if ( !entry->prev )
74 Q_ASSERT( mHead == entry );
75 entry->next->prev =
nullptr;
77 entry->next =
nullptr;
79 else if ( !entry->next )
82 Q_ASSERT( mTail == entry );
83 entry->prev->next =
nullptr;
85 entry->prev =
nullptr;
90 entry->prev->next = entry->next;
91 entry->next->prev = entry->prev;
92 entry->next =
nullptr;
93 entry->prev =
nullptr;
96 Q_ASSERT( !entry->prev );
97 Q_ASSERT( !entry->next );
100 QgsChunkListEntry *QgsChunkList::takeFirst()
102 QgsChunkListEntry *entry = mHead;
107 QgsChunkListEntry *QgsChunkList::takeLast()
109 QgsChunkListEntry *entry = mTail;
114 void QgsChunkList::insertFirst( QgsChunkListEntry *entry )
116 insertEntry( entry, mHead );
119 void QgsChunkList::insertLast( QgsChunkListEntry *entry )
121 insertEntry( entry,
nullptr );
124 bool QgsChunkList::isEmpty()
const 126 return mHead ==
nullptr;