Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GmsList Class Reference

#include <GmsList.h>

List of all members.

Public Member Functions

GmsListappend (GmsListLink *)
GmsListappend (GmsListLink *)
unsigned int count () const
unsigned int count () const
GmsListLinkfirst () const
GmsListLinkfirst () const
 GmsList ()
 GmsList ()
GmsListinsertAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListinsertAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListLinklast () const
GmsListLinklast () const
GmsListmoveAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListmoveAfter (GmsListLink *link, GmsListLink *insertHere)
GmsListprepend (GmsListLink *)
GmsListprepend (GmsListLink *)
GmsListremove (GmsListLink *)
GmsListremove (GmsListLink *)
void reset ()
void reset ()
virtual ~GmsList ()
virtual ~GmsList ()

Protected Attributes

unsigned int _count
GmsListLink_first
GmsListLink_first
GmsListLink_last
GmsListLink_last


Constructor & Destructor Documentation

GmsList::GmsList  )  [inline]
 

00039 { _first = _last = 0; _count = 0;}

GmsList::~GmsList  )  [virtual]
 

00018 {}

GmsList::GmsList  )  [inline]
 

00039 { _first = _last = 0; _count = 0;}

virtual GmsList::~GmsList  )  [virtual]
 


Member Function Documentation

GmsList& GmsList::append GmsListLink  ) 
 

GmsList & GmsList::append GmsListLink  ) 
 

00021 {  // add an item to the end of a list
00022         if ( _last ) {
00023                 _last->_next = l;
00024                 l->_prev = _last;
00025         }
00026         else
00027                 _first = l;
00028         
00029         _last = l;
00030 
00031         _count++;
00032 
00033         return *this;
00034 }

unsigned int GmsList::count  )  const [inline]
 

00043 { return _count;}

unsigned int GmsList::count  )  const [inline]
 

00043 { return _count;}

GmsListLink* GmsList::first void   )  const [inline]
 

00042 { return _first; }

GmsListLink* GmsList::first void   )  const [inline]
 

00042 { return _first; }

GmsList& GmsList::insertAfter GmsListLink link,
GmsListLink insertHere
 

GmsList & GmsList::insertAfter GmsListLink link,
GmsListLink insertHere
 

00052 {  // add an item to the middle of a list
00053         GmsListLink *after = 0;
00054         if ( here != 0 ) {
00055           after = here->_next;
00056           here->_next = l;
00057           l->_prev = here;
00058         }
00059         else {
00060           after = _first;
00061           l->_prev = 0;
00062           _first = l;
00063         }
00064         l->_next = after;
00065 
00066         if (after == 0) {
00067           _last = l;
00068         }
00069         else {
00070           after->_prev = l;
00071         }
00072 
00073         _count++;
00074 
00075         return *this;
00076 }

GmsListLink* GmsList::last  )  const [inline]
 

00041 { return _last; }

GmsListLink* GmsList::last  )  const [inline]
 

00041 { return _last; }

GmsList& GmsList::moveAfter GmsListLink link,
GmsListLink insertHere
 

GmsList & GmsList::moveAfter GmsListLink link,
GmsListLink insertHere
 

00078 {  // add an item from one place in list to another
00079 
00080         // First remove it from its current position
00081         if ( l == _first )
00082                 _first = _first->_next;
00083         if ( l == _last )
00084                 _last = _last->_prev;
00085         
00086         if ( l->_next ) {
00087                 l->_next->_prev = l->_prev;
00088         }
00089         if ( l->_prev ) {
00090                 l->_prev->_next = l->_next;
00091         }
00092 
00093 
00094         GmsListLink *after = 0;
00095         if ( here != 0 ) {
00096           after = here->_next;
00097           here->_next = l;
00098           l->_prev = here;
00099         }
00100         else {
00101           after = _first;
00102           l->_prev = 0;
00103           _first = l;
00104         }
00105         l->_next = after;
00106 
00107         if (after == 0) {
00108           _last = l;
00109         }
00110         else {
00111           after->_prev = l;
00112         }
00113 
00114 
00115         return *this;
00116 }

GmsList& GmsList::prepend GmsListLink  ) 
 

GmsList & GmsList::prepend GmsListLink  ) 
 

00037 {  // add an item to the beginning of a list
00038         if ( _first ) {
00039                 _first->_prev = l;
00040                 l->_next = _first;
00041         }
00042         else
00043                 _last = l;
00044 
00045         _first = l;
00046 
00047         _count++;
00048 
00049         return *this;
00050 }

GmsList& GmsList::remove GmsListLink  ) 
 

GmsList & GmsList::remove GmsListLink  ) 
 

00119 {  // remove an item from the list
00120         if ( l == _first )
00121                 _first = _first->_next;
00122         if ( l == _last )
00123                 _last = _last->_prev;
00124         
00125         if ( l->_next ) {
00126                 l->_next->_prev = l->_prev;
00127         }
00128         if ( l->_prev ) {
00129                 l->_prev->_next = l->_next;
00130         }
00131         l->_next = 0;
00132         l->_prev = 0;
00133 
00134         _count--;
00135 
00136         return *this;
00137 }

void GmsList::reset  )  [inline]
 

00051 { _first = _last = 0; _count = 0;}

void GmsList::reset  )  [inline]
 

00051 { _first = _last = 0; _count = 0;}


Member Data Documentation

unsigned int GmsList::_count [protected]
 

GmsListLink* GmsList::_first [protected]
 

GmsListLink* GmsList::_first [protected]
 

GmsListLink* GmsList::_last [protected]
 

GmsListLink* GmsList::_last [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:16:36 2011 for BOSS6.5.5 by  doxygen 1.3.9.1