// file: tok_trace_3.cc
//

// isip include files
//
#include "token.h"
#include "token_constants.h"
 
// method: prune_all_cc
//
// arguments:
//  logical_1 flag: (input) alignment mode flag
//  int_4& ndel: (output) number of deleted traces
//
// return: a logical_1 indicating success
//
// this method prunes the trace in the token
//
logical_1 Token::prune_all_cc(logical_1 flag_a, int_4& ndel_a) {

  // memory manager
  //
  Memory_manager* manager = Link_list::get_manager_cc();

  // check if this token has been populated with traces
  //
  if (trace_d != (Trace*)NULL) {
  
    // adjust ref counts if needed
    //
    if (flag_a == ISIP_TRUE) {
      trace_d->decr_ref_cc();
    }
      
    // prune the trace
    //
    manager->delete_cc(trace_d);
    trace_d = (Trace*)NULL;
      
    // increment deletion count
    //
    ndel_a++;
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
