// file: ll_size_0.cc
//

// isip include files
//
#include "link_list.h"
#include "link_list_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 Link_list::size_cc() {

  // set the size variable
  //
  int_4 size = 0;
  
  // add the size of each constituent data
  //
  size += sizeof(Link_node*);      // curr_d

  // add the sizes of the links
  //
  Link_node* node = head_d;
  while (node != (Link_node*)NULL) {
    size += sizeof(Link_node*);
    size += node->size_cc();
    node = node->get_next_cc();
  }
  
  // exit gracefully
  //
  return size;
}
