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

strtable::chain_elem Class Reference

Collaboration diagram for strtable::chain_elem:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 chain_elem (void)
 ~chain_elem (void)
STRINGsearch_list (STRING item)
 Search for a string in a hash chain list.

unsigned int list_len (void)

Public Attributes

LIST< STRING * > list

Private Member Functions

 chain_elem (const chain_elem &)

Constructor & Destructor Documentation

strtable::chain_elem::chain_elem const chain_elem  )  [inline, private]
 

Definition at line 65 of file strtable.h.

00065 {}

strtable::chain_elem::chain_elem void   )  [inline]
 

Definition at line 67 of file strtable.h.

References list.

00067 { list = LIST<STRING *>(); }

strtable::chain_elem::~chain_elem void   )  [inline]
 

Definition at line 68 of file strtable.h.

References LIST< STRING * >::dealloc(), and list.

00068 { list.dealloc(); }


Member Function Documentation

unsigned int strtable::chain_elem::list_len void   )  [inline]
 

Definition at line 72 of file strtable.h.

References LIST< STRING * >::first(), list, LIST< STRING * >::next(), and NULL.

00073         {
00074             LIST<STRING *>::handle h;
00075             int len = 0;;
00076             
00077             for (h = list.first(); h != NULL; h = list.next(h)) {
00078                 len++;
00079             } // for
00080             return len;
00081         } // list_len

STRING * strtable::chain_elem::search_list STRING  item  ) 
 

Search for a string in a hash chain list.

Definition at line 18 of file strtable.C.

References LIST< STRING * >::first(), LIST< STRING * >::get_item(), STRING::GetText(), list, LIST< STRING * >::next(), and NULL.

00019 {
00020     LIST<STRING *>::handle h;
00021     STRING *list_str, *str;
00022     
00023     str = NULL;
00024     for (h = list.first(); h != NULL; h = list.next(h)) {
00025         list_str = list.get_item( h );
00026         if ( strcmp(list_str->GetText(), item.GetText()) == 0 ) {
00027             str = list_str;
00028             break;
00029         }  // if
00030     } // for
00031     
00032     return str;
00033 } // search_list


Member Data Documentation

LIST<STRING *> strtable::chain_elem::list
 

Definition at line 63 of file strtable.h.

Referenced by chain_elem(), list_len(), search_list(), and ~chain_elem().


The documentation for this class was generated from the following files:
Generated on Wed Mar 31 21:16:09 2004 for Data Structures for a VHDL Compiler by doxygen 1.3.3