DList Class Reference

#include <_link.h>

List of all members.

Public Member Functions

 DList ()
virtual ~DList ()
void Clear (void)
int32s GetCount (void)
DLinkableGetHead (void)
DLinkableGetTail (void)
void Append (DLinkable *ptr)
void InsertHead (DLinkable *ptr)
void Insert (DLinkable *prv, DLinkable *ptr, DLinkable *nxt)
DLinkableRemoveHead (void)
DLinkableRemoveTail (void)
DLinkableRemove (DLinkable *ptr)
template<class T >
void Iterator (void(T::*pf)(DLinkable *))

Private Attributes

DLinkablepHead
DLinkablepTail
int32s Count


Detailed Description

Definition at line 112 of file _link.h.


Constructor & Destructor Documentation

DList::DList (  )  [inline]

Definition at line 120 of file _link.h.

00120 { Clear(); }

virtual DList::~DList (  )  [inline, virtual]

Definition at line 121 of file _link.h.

00121 {}


Member Function Documentation

void DList::Append ( DLinkable ptr  )  [inline]

Definition at line 128 of file _link.h.

00128 { Insert( pTail, ptr, NULL ); }

void DList::Clear ( void   )  [inline]

Definition at line 123 of file _link.h.

00123 { pHead = pTail = NULL;  Count = 0; }

int32s DList::GetCount ( void   )  [inline]

Definition at line 124 of file _link.h.

00124 { return Count; }

DLinkable* DList::GetHead ( void   )  [inline]

Definition at line 125 of file _link.h.

00125 { return pHead; }

DLinkable* DList::GetTail ( void   )  [inline]

Definition at line 126 of file _link.h.

00126 { return pTail; }

void DList::Insert ( DLinkable prv,
DLinkable ptr,
DLinkable nxt 
) [inline]

Definition at line 131 of file _link.h.

00132     { 
00133         if( ptr ) 
00134         { 
00135             if( prv == NULL || nxt == pHead ) pHead = ptr;
00136             if( nxt == NULL || prv == pTail ) pTail = ptr;
00137             ptr->Insert(prv, nxt); 
00138             Count++; 
00139         }
00140     }

void DList::InsertHead ( DLinkable ptr  )  [inline]

Definition at line 129 of file _link.h.

00129 { Insert( NULL, ptr, pHead ); }

template<class T >
void DList::Iterator ( void(T::*)(DLinkable *)  pf  )  [inline]

Definition at line 157 of file _link.h.

00158     {
00159         for( DLinkable* ptr = pHead; ptr; ptr=ptr->GetNext() ) pf( ptr );
00160     }

DLinkable* DList::Remove ( DLinkable ptr  )  [inline]

Definition at line 144 of file _link.h.

00145     { 
00146         if( ptr ) 
00147         { 
00148             if( ptr == pHead ) pHead = pHead->GetNext();
00149             if( ptr == pTail ) pTail = pTail->GetPrev();
00150             ptr->Remove(); 
00151             Count--; 
00152         } 
00153         return ptr;
00154     }

DLinkable* DList::RemoveHead ( void   )  [inline]

Definition at line 142 of file _link.h.

00142 { return Remove( pHead ); }

DLinkable* DList::RemoveTail ( void   )  [inline]

Definition at line 143 of file _link.h.

00143 { return Remove( pTail ); }


Member Data Documentation

int32s DList::Count [private]

Definition at line 117 of file _link.h.

DLinkable* DList::pHead [private]

Definition at line 115 of file _link.h.

DLinkable* DList::pTail [private]

Definition at line 116 of file _link.h.


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

Generated on Thu Nov 28 14:47:22 2013 for red_wireless by  doxygen 1.5.7.1