📄 ancr_05.cc
字号:
// file: $isip/class/asr/Anchor/ancr_5.cc// version: $Id: ancr_05.cc,v 1.2 2002/02/07 15:48:48 alphonso Exp $//// isip include files//#include "Anchor.h"// method: assign//// arguments:// Anchor& arg: (input) Anchor object//// return: logical error status//// this method assigns the input object top the current object//boolean Anchor::assign(const Anchor& arg_a) { // assign input object to the current object // id_d.assign(arg_a.id_d); unit_d.assign(arg_a.unit_d); offset_d.assign(arg_a.offset_d); anchored_d.assign(arg_a.anchored_d); // exit gracefully // return true;}// method: clear//// arguments:// Integral::CMODE cmode: (input) clear mode//// return: logical error status//// this method assigns the input object top the current object//boolean Anchor::clear(Integral::CMODE cmode_a) { // clear the member data // id_d.clear(cmode_a); unit_d.clear(cmode_a); offset_d = 0.0; anchored_d = false; // exit gracefully // return true; }// method: compare//// arguments:// String& arg1: (input) first anchor id// String& arg2: (input) second anchor id//// return: logical error status//// this method determines if the base id's are the same//boolean Anchor::compare(const String& arg1_a, const String& arg2_a) const { // declare local variables // long pos1; String temp1; long pos2; String temp2; // find the position of the first delimiter in the id // pos1 = arg1_a.lastChr(L":"); pos2 = arg2_a.lastChr(L":"); // determine the base from the given id for the first // if (pos1 == Integral::NO_POS) { temp1.assign(arg1_a); } else { arg1_a.substr(temp1, pos1, -1); } // determine the base from the given id for the second // if (pos1 == Integral::NO_POS) { temp2.assign(arg2_a); } else { arg2_a.substr(temp2, pos2, -1); } // determine if the id's are equal // return (temp1.eq(temp2));}// method: eq//// arguments:// Anchor& arg: (input) Anchor object//// return: logical error status//// this method determines if the input object is equal to the current object//boolean Anchor::eq(const Anchor& arg_a) const { // check if the id's are the same // if(!compare(id_d, arg_a.id_d)) { return false; } // check if the anchored flag are the same // if(!anchored_d.eq(arg_a.anchored_d)) { return false; } // check if the offsets are the same // if(!Integral::almostEqual((float)offset_d, arg_a.getOffset())) { return false; } // check if the units are the same // if(!unit_d.eq(arg_a.unit_d)) { return false; } // exit gracefully // return true; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -