// file: ht_cstr_0.cc
//

// isip include files
//
#include "hash_table.h"
#include "hash_table_constants.h"
 
// method: destructor
//
// arguments: none
//
// return: none
//
// this is the destructor for the class
//
Hash_table::~Hash_table() {

  // free memory in the hash table lists
  // this is assuming that the items are deleted independently
  //
  Hash_cell* next = (Hash_cell*)NULL;
  for (int_4 k = 0; k < size_d; k++) {
    for (Hash_cell* cell = cells_d[k]; cell != (Hash_cell*)NULL;
	 cell = next) {
      next = cell->get_next_cc();
      delete cell;
    }
  }
  if (cells_d != (Hash_cell**)NULL) {
    delete [] cells_d;
    cells_d = (Hash_cell**)NULL;
  }

  // reset size
  //
  size_d = (int_4)0;
  mode_d = HASH_TABLE_DEF_MODE;
  
  // exit gracefully
  //
}
