Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ScrnObjList Class Reference

#include <scrnobj.h>

List of all members.

Public Methods

 ScrnObjList ()
 ~ScrnObjList ()
void Insert (ScrnObj *a)
void Append (ScrnObj *a)
void Remove (ScrnObj *a)
ScrnObjGetCurrent (void)
bool Reset (void)
bool Next (void)
void Nuke (void)

Private Attributes

ScrnObjFirst
ScrnObjLast
ScrnObjCurrent


Constructor & Destructor Documentation

ScrnObjList::ScrnObjList   [inline]
 

Definition at line 47 of file scrnobj.h.

00047 { First = Last = Current = NULL; }

ScrnObjList::~ScrnObjList   [inline]
 

Definition at line 48 of file scrnobj.h.

References Nuke().

00048 { Nuke (); }


Member Function Documentation

void ScrnObjList::Append ScrnObj   a
 

Definition at line 25 of file scrnobj.c.

References Insert(), Last, and ScrnObj::Next.

Referenced by Display::Add().

00026 {
00027   if (Last)
00028   {
00029     Last->Next = a;
00030     Last = a;
00031   }
00032   else
00033     Insert (a);
00034 }

ScrnObj* ScrnObjList::GetCurrent void    [inline]
 

Definition at line 52 of file scrnobj.h.

Referenced by Display::Dispatch(), Display::Draw(), and Display::Erase().

00052 { return Current; }

void ScrnObjList::Insert ScrnObj   a
 

Definition at line 14 of file scrnobj.c.

References Current, First, Last, and ScrnObj::Next.

Referenced by Append().

00015 {
00016   a->Next = First;
00017   First = a;
00018   if (!Current)
00019     Current = First;
00020   if (!Last)
00021     Last = First;
00022 }

bool ScrnObjList::Next void   
 

Definition at line 77 of file scrnobj.c.

References Current, and ScrnObj::Next.

Referenced by Display::Dispatch(), Display::Draw(), and Display::Erase().

00078 {
00079   if (Current)
00080     Current = Current->Next;
00081   return (bool) (Current);
00082 }

void ScrnObjList::Nuke void   
 

Definition at line 85 of file scrnobj.c.

References Current, First, and Last.

Referenced by ~ScrnObjList().

00086 {
00087   delete First;
00088   First = Current = Last = NULL;
00089 }

void ScrnObjList::Remove ScrnObj   a
 

Definition at line 37 of file scrnobj.c.

References Current, First, Last, and ScrnObj::Next.

00038 {
00039   if (First == a)
00040   {
00041     ScrnObj* tmp = First;
00042     First = First->Next;
00043     delete tmp;
00044   }
00045   else
00046   {
00047     ScrnObj* prev = First;
00048     ScrnObj* curr = First->Next;
00049     while (curr)
00050     {
00051       if (curr == a)
00052       {
00053   prev->Next = curr->Next;
00054   if (curr == Last)
00055     Last = prev;
00056   delete curr;
00057   curr = NULL;
00058       }
00059       else
00060       {
00061   prev = curr;
00062   curr = curr->Next;
00063       }
00064     }
00065   }
00066   Current = First;
00067 }

bool ScrnObjList::Reset void   
 

Definition at line 70 of file scrnobj.c.

References Current, and First.

Referenced by Display::Dispatch(), Display::Draw(), and Display::Erase().

00071 {
00072   Current = First;
00073   return (bool) (Current);
00074 }


Member Data Documentation

ScrnObj* ScrnObjList::Current [private]
 

Definition at line 45 of file scrnobj.h.

Referenced by Insert(), Next(), Nuke(), Remove(), and Reset().

ScrnObj* ScrnObjList::First [private]
 

Definition at line 43 of file scrnobj.h.

Referenced by Insert(), Nuke(), Remove(), and Reset().

ScrnObj* ScrnObjList::Last [private]
 

Definition at line 44 of file scrnobj.h.

Referenced by Append(), Insert(), Nuke(), and Remove().


The documentation for this class was generated from the following files:
Generated on Sun Jul 6 23:07:18 2003 for Scotland Yard by doxygen1.2.15