// file: $isip/class/search/Trace/trace_07.cc // version: $Id: trace_07.cc 9347 2003-11-26 20:46:15Z alphonso $ // // isip include files // #include "Trace.h" #include // method: eq // // arguments: // const Trace& compare_trace: (input) trace to compare // // return: true if the traces are equivalent, else false // // compare two traces. they are equivalent if they have equivalent history // objects // bool8 Trace::eq(const Trace& compare_trace_a) const { // compare the history pointers // if (history_d != compare_trace_a.history_d) { return false; } // compare the symbol pointers // if (symbol_d != compare_trace_a.symbol_d) { return false; } // compare the nsymbols // if ((int32)nsymbol_length_d > 0) { for (int32 i = 0; i < (int32)nsymbol_length_d; i++) { if (nsymbol_d[i] != compare_trace_a.nsymbol_d[i]) { return false; } } } // if we reached this far then they must be equal // return true; } // method: setHistory // // arguments: // const History* new_hist: (input) the history to copy // // return: a bool8 indicating status // // this method sets the trace's history to the input history // bool8 Trace::setHistory(const History* new_hist_a) { // set the history // return (history_d = const_cast(new_hist_a)); } // method: getHistory // // arguments: none // // return: a bool8 indicating status // // this method gets the trace's history // History* Trace::getHistory() const { // get the history // return history_d; } // method: setSymbol // // arguments: // const Symbol& new_symbol: (input) the symbol to copy // // return: a bool8 indicating status // // this method sets the trace's symbol to the input symbol // bool8 Trace::setSymbol(const Context* new_symbol_a) { // set the symbol // return (symbol_d = const_cast(new_symbol_a)); } // method: getSymbol // // arguments: none // // return: a bool8 indicating status // // this method gets the trace's symbol // Context* Trace::getSymbol() const { // get the symbol // return symbol_d; }