// file: subpath_match.h
//
// this is the header for the subpath match class
//

// make sure definitions are only made once
//
#ifndef __ISIP_SUBPATH_MATCH
#define __ISIP_SUBPATH_MATCH

// isip include files
//
#ifndef __ISIP_INTEGRAL
#include <integral.h>
#endif

// forward declaration of classes
//
#ifndef __ISIP_LINK_LIST
#include <link_list.h>
#endif

#ifndef __ISIP_WORD
#include <word.h>
#endif

#include "subpath_match_constants.h"

// Subpath_match: a class that is used to store information about a lattice
// subpath match for spoken term detection applications. This class also
// provides functions for comparing two matches and determining which matches
// to prune
//
class Subpath_match {
  
  //---------------------------------------------------------------------------
  //
  // protected data
  //
  //---------------------------------------------------------------------------
protected:
  
  // match information
  //
  int_4 start_time_d;               // start frame of the match
  int_4 end_time_d;                 // end frame of the match
  float_4 score_d;                  // likelihood score of this match

  int_4 num_models_d;               // number of models the match spans 
    
  int_4 start_time_pad_d;             // time pad before start of the utterance
  int_4 end_time_pad_d;              // time bad after end of the utterance
  
  //---------------------------------------------------------------------------
  //
  // public methods
  //
  //---------------------------------------------------------------------------
public:
  
  // required methods
  //
  char_1* name_cc();
  volatile void error_handler_cc(char_1* mname, char_1* msg);
  logical_1 debug_cc(FILE* fp, char_1* message);
  int_4 size_cc();
    
  // destructors/constructors
  //
  ~Subpath_match();                             // destructor
  Subpath_match();                              // default constructor
  Subpath_match(int_4 start, int_4 end, float_4 score); // overloaded
  Subpath_match(Subpath_match& match);        // copy constructor
    
  // methods to set generic information
  //
  logical_1 set_start_time_cc(int_4 start_time);
  logical_1 set_end_time_cc(int_4 end_time);
  logical_1 set_score_cc(float_4 score);
  logical_1 set_num_models_cc(int_4 num_models);
  logical_1 set_start_time_pad_cc(int_4 start_time_pad);
  logical_1 set_end_time_pad_cc(int_4 end_time_pad);

  // methods to set generic information
  //SUBPATH_MATCH_DEFAULT_OVERLAP_THRES
  int_4 get_start_time_cc();
  int_4 get_end_time_cc();
  float_4 get_score_cc();
  int_4 get_num_models_cc();
  int_4 get_start_time_pad_cc();
  int_4 get_end_time_pad_cc();

  // methods to compare subpath matches
  //
  logical_1 greater_than_cc(Subpath_match* match);
  logical_1 equal_to_cc(Subpath_match* match, 
			float_4 overlap_thresh = SUBPATH_MATCH_DEFAULT_OVERLAP_THRESH);
  
  //---------------------------------------------------------------------------
  //
  // private methods
  //
  //---------------------------------------------------------------------------
private:

};

// end of file
// 
#endif
