// file: $isip/class/pr/LanguageModelXML/lmxml_01.cc
// version: $Id: lmxml_01.cc 10420 2006-02-06 20:39:23Z may $

// ISIP include files
//
#include "LanguageModelXML.h"

// system include file needed for the typeid function.
//
#include <typeinfo>

// method: debug
//
// arguments:
//   const unichar* msg: (input) a message to display with the
//     member data information
//
// return: a boolean indicating status
//
boolean LanguageModelXML::debug(const unichar* msg_a) const {
  
  // exit gracefully
  //
  symbol_table_d.debug(L"symbol_table_d");
  hg_d.debug(L"hg_d");
  grammars_d.debug(L"grammars_d");
  rules_d.debug(L"rules_d");

  return true;
}

// method: clear
//
// arguments:
//  Integral::CMODE ctype: (input) clear mode
//
// return: a boolean value indicating status
//
// this method resets the data members to the default values
//
boolean LanguageModelXML::clear(Integral::CMODE ctype_a) {
  
  if(ctype_a != Integral::RETAIN) {
    // clear the member data
    //
    hg_d.clear(ctype_a);
    grammars_d.clear(ctype_a);
    temp_rule_d.clear(ctype_a);
    rules_d.clear(ctype_a);
    grammar_start_tag_d.clear(ctype_a);
    grammar_end_tag_d.clear(ctype_a);
    symbol_table_d.clear(ctype_a);
    debug_level_d=Integral::NONE;
  }
  
  // indicate success
  //
  return true;
}

// method: operator=
//
// arguments:
//  const LanguageModelXML& arg: (input) input object to copy
//
// return: a boolean value indicating status
//
// this method copies the argument over this object
//
boolean LanguageModelXML::operator=(const LanguageModelXML& lmxml_a) {
  return assign(lmxml_a);
}

// method: assign
//
// arguments:
//  const LanguageModelXML& arg: (input) object to copy
//
// return: a boolean value indicating status
//
// this method assigns the input object to current object
//
boolean LanguageModelXML::assign(const LanguageModelXML& lmxml_a) {
  
  return (true);
}

// method: assign
//
// arguments:
//  const LanguageModelBase& arg: (input) object to copy
//
// return: a boolean error status
//
// this method assigns input argument to current argument
//
boolean LanguageModelXML::assign(const LanguageModelBase& arg_a) {
  
  if (typeid(arg_a) == typeid(LanguageModelXML)) {
    return assign((LanguageModelXML&)arg_a);
  }
  else {
    return Error::handle(name(), L"assign", Error::ARG, __FILE__, __LINE__);
  }
}

// method: operator==
//
// arguments:
//  const LanguageModelXML& arg: (input) input object to compare
//
// return: a boolean value indicating status
//
// this method checks whether the current object is identical to the
// input object
//
boolean LanguageModelXML::operator==(const LanguageModelXML& lmxml_a) const {
  return eq(lmxml_a);
}

// method: eq
//
// arguments:
//  const LanguageModelXML& lmxml: (input) input object to compare
//
// return: a boolean value indicating equality
//
// this method checks whether the current object is identical to the
// input object
//
boolean LanguageModelXML::eq(const LanguageModelXML& lmxml_a) const {
  
  // compare all non/debug member data
  //
  return(true);  
}

// method: eq
//
// arguments:
//  const LanguageModelBase& arg: (input) object to test
//
// return: a boolean value indicating equality
//
// this method is part of the LanguageModelBase interface contract
// which compares two virtual model types
//
boolean LanguageModelXML::eq(const LanguageModelBase& arg_a) const {
  
  if (typeid(arg_a) == typeid(LanguageModelXML)) {
    return eq((LanguageModelXML&)arg_a);
  }
  else {
    return Error::handle(name(), L"eq", Error::ARG, __FILE__, __LINE__);
  }
}
