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

PathDict Class Reference

#include <PathDict.hpp>

List of all members.

Public Methods

void Init ()
 PathDict ()
PathDictNodeFindOrCreateRootPath (VPathExpr *pathexpr)
PathDictNodeFindOrCreatePath (PathDictNode *parent, TLabelID labelid)


Constructor & Destructor Documentation

PathDict::PathDict   [inline]
 

Definition at line 175 of file PathDict.hpp.

00175 {  Init();  }


Member Function Documentation

PathDictNode* PathDict::FindOrCreatePath PathDictNode   parent,
TLabelID    labelid
[inline]
 

Definition at line 215 of file PathDict.hpp.

00218    {
00219       unsigned long hashidx=ComputePathDictHashIdx(parent,labelid);
00220       PathDictNode   *node=hashtable[hashidx];
00221 
00222 #ifdef PROFILE
00223       lookupcount++;
00224 #endif
00225 
00226       while(node!=NULL)
00227       {
00228 #ifdef PROFILE
00229          hashitercount++;
00230 #endif
00231 
00232          if((node->parent==parent)&&(node->labelid==labelid))
00233             return node;
00234 
00235          node=node->nextsamehash;
00236       }
00237 
00238       // We must create a new node
00239       node=new PathDictNode();
00240 
00241 #ifdef PROFILE
00242       nodecount++;
00243 #endif
00244 
00245       node->parent=parent;
00246       node->labelid=labelid;
00247       node->compresscontblock=NULL;
00248 
00249       node->nextsamehash=hashtable[hashidx];
00250       hashtable[hashidx]=node;
00251 
00252       return node;
00253    }

PathDictNode* PathDict::FindOrCreateRootPath VPathExpr   pathexpr [inline]
 

Definition at line 177 of file PathDict.hpp.

00179    {
00180       unsigned long  hashidx=ComputePathDictHashIdx(pathexpr);
00181       PathDictNode   *node=hashtable[hashidx];
00182 #ifdef PROFILE
00183       lookupcount++;
00184 #endif
00185 
00186       while(node!=NULL)
00187       {
00188 #ifdef PROFILE
00189          hashitercount++;
00190 #endif
00191          if(node->pathexpr==pathexpr)
00192             return node;
00193 
00194          node=node->nextsamehash;
00195       }
00196 
00197       // We must create a new node
00198       node=new PathDictNode();
00199 
00200 #ifdef PROFILE
00201       nodecount++;
00202 #endif
00203 
00204       node->parent=NULL;
00205       node->pathexpr=pathexpr;
00206       node->compresscontblock=NULL;
00207 //      node->labelid=LABEL_UNDEFINED;
00208 
00209       node->nextsamehash=hashtable[hashidx];
00210       hashtable[hashidx]=node;
00211 
00212       return node;
00213    }

void PathDict::Init   [inline]
 

Definition at line 145 of file PathDict.hpp.

00147    {
00148       int i;
00149       for(i=0;i<PATHDICT_HASHSIZE;i++)
00150          hashtable[i]=NULL;
00151 #ifdef PROFILE
00152       nodecount=0;
00153       lookupcount=0;
00154       hashitercount=0;
00155 #endif
00156    }


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