18 #ifndef tsDLListH_include
19 #define tsDLListH_include
55 unsigned count ()
const;
56 void add ( T & item );
58 void push ( T & item );
60 void remove ( T & item );
64 void insertAfter ( T & item, T & itemBefore );
65 void insertBefore ( T & item, T & itemAfter );
66 int find (
const T & item )
const;
67 T * first (
void )
const;
68 T * last (
void )
const;
97 const T & operator * ()
const;
98 const T * operator -> ()
const;
103 const T * pointer ()
const;
120 bool operator == (
const tsDLIter<T> & rhs )
const;
121 bool operator != (
const tsDLIter<T> & rhs )
const;
123 T & operator * ()
const;
124 T * operator -> ()
const;
129 T * pointer ()
const;
148 pNext (0), pPrev(0) {}
183 return this->itemCount;
212 this->itemCount = 0u;
223 if ( this->pLast == &item ) {
224 this->pLast = theNode.pPrev;
228 nextNode.pPrev = theNode.pPrev;
231 if ( this->pFirst == &item ) {
232 this->pFirst = theNode.pNext;
236 prevNode.pNext = theNode.pNext;
249 destination.pFirst = this->pFirst;
250 destination.pLast = this->pLast;
251 destination.itemCount = this->itemCount;
263 T *pItem = this->pFirst;
266 this->
remove ( *pItem );
291 if ( addList.itemCount != 0u ) {
292 if ( this->itemCount == 0u ) {
293 this->pFirst = addList.pFirst;
298 pLastNode->pNext = addList.pFirst;
299 pAddListFirstNode->pPrev = addList.pLast;
301 this->pLast = addList.pLast;
302 this->itemCount += addList.itemCount;
318 theNode.pPrev = this->pLast;
320 if ( this->itemCount ) {
322 lastNode.pNext = &item;
325 this->pFirst = &item;
344 nodeItem.pPrev = &itemBefore;
345 nodeItem.pNext = nodeBefore.pNext;
346 nodeBefore.pNext = &item;
348 if (nodeItem.pNext) {
350 pNextNode->pPrev = &item;
370 node.pNext = &itemAfter;
371 node.pPrev = nodeAfter.pPrev;
372 nodeAfter.pPrev = &item;
376 prevNode.pNext = &item;
379 this->pFirst = &item;
394 if ( pushList.itemCount != 0u ) {
395 if ( this->itemCount ) {
398 pFirstNode->pPrev = pushList.pLast;
399 pAddListLastNode->pNext = this->pFirst;
402 this->pLast = pushList.pLast;
404 this->pFirst = pushList.pFirst;
405 this->itemCount += pushList.itemCount;
420 theNode.pNext = this->pFirst;
422 if ( this->itemCount ) {
424 pFirstNode->pPrev = & item;
427 this->pLast = & item;
430 this->pFirst = &item;
448 while ( iter.valid () ) {
449 if ( iter == thisItem ) {
499 pEntry ( pInitialEntry ) {}
508 return this->pEntry != 0;
514 return this->pEntry == rhs.pEntry;
520 return this->pEntry != rhs.pEntry;
526 this->pEntry = rhs.pEntry;
533 return *this->pEntry;
549 this->pEntry = node.pNext;
561 this->pEntry = node.pNext;
572 this->pEntry = entryNode.pPrev;
584 this->pEntry = entryNode.pPrev;
600 pEntry ( pInitialEntry ) {}
609 return this->pEntry != 0;
615 return this->pEntry == rhs.pEntry;
621 return this->pEntry != rhs.pEntry;
627 this->pEntry = rhs.pEntry;
634 return *this->pEntry;
647 this->pEntry = entryNode.pNext;
656 this->pEntry = entryNode.pNext;
664 this->pEntry = entryNode.pPrev;
673 this->pEntry = entryNode.pPrev;
683 #endif // tsDLListH_include