// file: tr_tr_ref_4.cc
//

// isip include files
//
#include "train_trace.h"
#include "train_trace_constants.h"

// method: incr_ref_path_cc
//
// arguments:
//  int_4 value: (input) the update value
//
// return: a logical_1 indicating status
//
// this method sets the reference count up or down by value for the
// whole path
//
logical_1 Train_Trace::incr_ref_path_cc(int_4 value_a) {

  // if this is not the sentence start trace
  //
  if (back_ptr_d != (Train_Trace**)NULL) {

    // update ref count
    //
    ref_count_d += value_a;

    // loop over all backpointers and update respective reference counts
    //
    for (int_4 i = 0; (i < backptr_size_d) &&
	   (back_ptr_d[i] != (Train_Trace*)NULL); i++) {
      back_ptr_d[i]->incr_ref_path_cc(value_a);
    }
  } // end if loop
    
  // exit gracefully
  //
  return ISIP_TRUE;
}
