// file: ht_size_0.cc
//

// isip include files
//
#include "hash_table.h"
#include "hash_table_constants.h"

// method: size_cc
//
// arguments: none
//
// return: an int_4 with number of bytes used by this object
//
// this method counts the size of the current object in bytes
//
int_4 Hash_table::size_cc() {

  // set the size variable
  //
  int_4 size = 0;
  
  // add the size of each constituent data
  //
  size += sizeof(int_4);                         // size_d
  size += sizeof(char_1);                         // mode_d
  size += size_d * sizeof(Hash_cell*);           // cells_d
  
  // add the size of the node lists
  //
  for (int_4 k = 0; k < size_d; k++) {
    for (Hash_cell* cell = cells_d[k]; cell != (Hash_cell*)NULL;
	 cell = cell->get_next_cc()) {
      size += cell->size_cc();
    }
  }
  
  // exit gracefully
  //
  return size;
}
