// file: hc_set_4.cc
//
 
// isip include files
//
#include "hash_cell.h"
#include "hash_cell_constants.h"
 
// method: set_cc
//
// arguments: 
//  int_4* key_vec : (input) the key_vec to set
//  int_4 key_size : (input) the length of the key vector
//  void_p item : (input) the void item pointer to set
//
// return: a logical_1 indicating success
//
// this method sets the key and the item pointer
//
logical_1 Hash_cell::set_cc(int_4* key_vec_a, int_4 key_size_a,
			    void_p item_a) {

  // free existing memory
  //
  if (key_size_d != key_size_a) {
    if (key_vec_d != (int_4*)NULL) {
      delete [] key_vec_d;
    }
    key_vec_d = new int_4[key_size_a];
  }

  key_size_d = key_size_a; 

  // copy new key vector
  //
  memcpy(key_vec_d, key_vec_a, key_size_d * sizeof(int_4));

  // set the item pointer
  //
  item_d = item_a;
    
  // exit gracefully
  //
  return ISIP_TRUE;
}


