// file: tr_phn_cstr_3.cc
//

// isip include files
//
#include "train_phone.h"
#include "train_phone_constants.h"

// method: constructor
//
// arguments:
//  const Train_Phone& phone : (input) phone model to copy
//
// return: none
//
// this is a copy constructor
//
Train_Phone::Train_Phone(const Train_Phone& phone_a) {

  // initialize name of the phone
  //
  name_d = new char_1[strlen((char*)phone_a.name_d) + (int_4)1];
  strcpy((char*)name_d, (char*)phone_a.name_d);
  
  // set the phone indices
  //
  num_phones_d = phone_a.num_phones_d;
  phones_d = new int_4[num_phones_d];
  for (int_4 i = 0; i < num_phones_d; i++) {
    phones_d[i] = phone_a.phones_d[i];
  }
  
  // set the model pointer
  //
  model_d = phone_a.model_d;
  active_d = phone_a.active_d;
  
  // exit gracefully
  //
}
