// file: tr_ln_insert_0.cc
//
 
// isip include files
//
#include "train_link_node.h"
#include "train_link_node_constants.h"
 
// method: insert_cc
//
// arguments:
//  Train_Link_node* node : (input) the node pointer to insert
//
// return: a logical_1 indicating success
//
// this method inserts a new node in the next position
//
logical_1 Train_Link_node::insert_cc(Train_Link_node* node_a) {
 
  // set the next node pointer by adjusting link pointers
  //
  if (next_d != (Train_Link_node*)NULL) {
    next_d->prev_d = node_a;
  }
  if (node_a != (Train_Link_node*)NULL) {
    node_a->prev_d = this;
    node_a->next_d = next_d;
  }
  next_d = node_a;  

  // exit gracefully
  //
  return ISIP_TRUE;
}
