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

CurPath Class Reference

#include <CurPath.hpp>

List of all members.

Public Methods

 CurPath ()
void AddLabel (TLabelID labelid)
TLabelID RemoveLabel ()
void InitIterator (CurPathIterator *it)


Constructor & Destructor Documentation

CurPath::CurPath   [inline]
 

Definition at line 102 of file CurPath.hpp.

00103    {
00104       firstblock.prev=NULL;
00105       firstblock.next=NULL;
00106       curblock=&firstblock;
00107       curlabel=curblock->labels;
00108 
00109 #ifdef PROFILE
00110      curdepth=maxdepth=0;
00111 #endif
00112    }


Member Function Documentation

void CurPath::AddLabel TLabelID    labelid [inline]
 

Definition at line 114 of file CurPath.hpp.

00116    {
00117 #ifdef PROFILE
00118       curdepth++;
00119          if(curdepth>maxdepth)
00120             maxdepth=curdepth;
00121 #endif
00122 
00123       if(curlabel==curblock->labels+CURPATH_LABELBLOCKSIZE)
00124          // Is there not enough space in the current block?
00125          // ==> Create new block, if there is no next block
00126          // (We never delete blocks)
00127       {
00128          if(curblock->next==NULL)
00129          {
00130             curblock->next=new CurPathLabelBlock();
00131             curblock->next->prev=curblock;
00132             curblock->next->next=NULL;
00133          }
00134          curblock=curblock->next;
00135 
00136          // We set the new current label
00137          curlabel=curblock->labels;
00138       }
00139       *curlabel=labelid;
00140       curlabel++;
00141    }

void CurPath::InitIterator CurPathIterator   it [inline]
 

Definition at line 164 of file CurPath.hpp.

00166    {
00167       it->curblock=curblock;
00168       it->curlabel=curlabel;
00169    }

TLabelID CurPath::RemoveLabel   [inline]
 

Definition at line 143 of file CurPath.hpp.

00145    {
00146 #ifdef PROFILE
00147       curdepth--;
00148 #endif
00149 
00150       curlabel--;
00151       if(curlabel==curblock->labels-1)
00152          // If the label in the previou block?
00153          // Go one block back
00154       {
00155          curblock=curblock->prev;
00156          if(curblock==NULL)   // No previous block? => Exit
00157             return LABEL_UNDEFINED;
00158 
00159          curlabel=curblock->labels+CURPATH_LABELBLOCKSIZE-1;
00160       }
00161       return *curlabel;
00162    }


The documentation for this class was generated from the following file:
Generated on Sat Oct 13 16:08:51 2001 for XMILL by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001