[an error occurred while processing this directive]

TableIterator Module Implementation Specifications


Client Specifications

Implementation Data Model

A TableIterator is a reference to a struct that contains a reference to the Table that it is iterating, an index into the array of hash lists for the Table, and a pointer to the current entry for the TableIterator. The more() function returns true when the array index is a valid index into the array of hash lists. The currentData() and currentKey() functions return data and keys accessed through the current entry pointer.

The advance() function usually just replaces the current entry pointer by the next member of the current entry. However, when this value is null, the advance must proceed to the first entry on the next non-empty hash list of the table. This is accomplished by the private function nextList(). This function is also used to initialize a TableIterator, after first setting its index to -1.

The currentData(), currentKey(), and advance() functions all call more() before doing anything else in order to check their preconditions. If this check fails then the program is terminated with an error message.

Private Importing Information

Source code for the TableIterator module is in Table.C and header information is in Table.h. Importing information is covered in Table Module Implementation Specifications.

Private Data Type Implementations

The following type is declared in Table.C.

Public Data Type Implementations

The following type is declared in Table.h.

Private Function Specifications

Private Function Algorithms

Public Function Algorithms

[an error occurred while processing this directive]