// file: $isip/class/algo/LogAreaRatio/lar_00.cc // version: $Id: lar_00.cc 6945 2001-05-08 05:43:27Z roberts $ // // isip include files // #include "LogAreaRatio.h" //------------------------------------------------------------------------ // // required public methods // //----------------------------------------------------------------------- // method: assign // // arguments: // const LogAreaRatio& arg: (input) object to be assigned // // return: a bool8 value indicating status // // this method assigns the input object to the current object // bool8 LogAreaRatio::assign(const LogAreaRatio& arg_a) { // assign data from the input LogAreaRatio object // algorithm_d = arg_a.algorithm_d; implementation_d = arg_a.implementation_d; // assign AlgorithmBase and exit gracefully // return AlgorithmBase::assign(arg_a); } // method: eq // // arguments: // const LogAreaRatio& arg: (input) object to be compared // // return: a bool8 value indicating status // // this method checks whether the current object is identical to the // input object // bool8 LogAreaRatio::eq(const LogAreaRatio& arg_a) const { // compare the data members // if ((algorithm_d != arg_a.algorithm_d) || (implementation_d != arg_a.implementation_d)) { // exit gracefully // return false; } // exit gracefully by checking the base class // return AlgorithmBase::eq(arg_a); } // method: clear // // arguments: // Integral::CMODE ctype: (input) clear mode // // return: a bool8 value indicating status // // this method resets the data members to the default values // bool8 LogAreaRatio::clear(Integral::CMODE ctype_a) { // reset the data members unless the mode is RETAIN // if (ctype_a != Integral::RETAIN) { algorithm_d = DEF_ALGORITHM; implementation_d = DEF_IMPLEMENTATION; } // call the base clear method // return AlgorithmBase::clear(ctype_a); } //--------------------------------------------------------------------------- // // class-specific public methods: // public methods required by the AlgorithmBase interface contract // //--------------------------------------------------------------------------- // method: assign // // arguments: // const AlgorithmBase& arg: (input) object to be assigned // // return: a bool8 value indicating status // // this method assigns the input algorithm object to the current object. // bool8 LogAreaRatio::assign(const AlgorithmBase& arg_a) { // case: input is an LogAreaRatio object // if (typeid(arg_a) == typeid(LogAreaRatio)) { return assign((LogAreaRatio&)arg_a); } // case: other // if the input algorithm object is not an LogAreaRatio object, return // an error. // else { return Error::handle(name(), L"assign", Error::ARG, __FILE__, __LINE__); } } // method: eq // // arguments: // const AlgorithmBase& arg: (input) object to be compared // // return: a bool8 value indicating status // // this method checks whether the current LogAreaRatio object is identical // to the input algorithm object. // bool8 LogAreaRatio::eq(const AlgorithmBase& arg_a) const { // case: input is an LogAreaRatio object // if (typeid(arg_a) == typeid(LogAreaRatio)) { return eq((LogAreaRatio&)arg_a); } // case: other // if the input algorithm object is not an LogAreaRatio object, return // an error. // else { return Error::handle(name(), L"eq", Error::ARG, __FILE__, __LINE__); } } //----------------------------------------------------------------------------- // // we define non-integral constants in the default constructor // //----------------------------------------------------------------------------- // constants: class name // const String LogAreaRatio::CLASS_NAME(L"LogAreaRatio"); // constants: i/o related constants // const String LogAreaRatio::DEF_PARAM(L""); const String LogAreaRatio::PARAM_ALGORITHM(L"algorithm"); const String LogAreaRatio::PARAM_IMPLEMENTATION(L"implementation"); // constants: NameMap(s) for the enumerated values // const NameMap LogAreaRatio::ALGO_MAP(L"LATTICE"); const NameMap LogAreaRatio::IMPL_MAP(L"KELLY_LOCHBAUM"); // static instantiations: memory manager // MemoryManager LogAreaRatio::mgr_d(sizeof(LogAreaRatio), LogAreaRatio::name());