// file: $isip/class/algo/SegmentConcat/segc_03.cc // version: $Id: segc_03.cc 9112 2003-05-01 19:51:01Z parihar $ // // isip include files // #include "SegmentConcat.h" // method: read // // arguments: // Sof& sof: (input) sof file object // int32 tag: (input) sof object instance tag // const String& name: (input) sof object instance name // // return: a bool8 value indicating status // // this method has the object read itself from an Sof file according // to the specified name and tag // bool8 SegmentConcat::read(Sof& sof_a, int32 tag_a, const String& name_a) { // read the instance of the object from the Sof file // if (!sof_a.find(name_a, tag_a)) { return false; } // read the actual data from the sof file // return readData(sof_a); } // method: readData // // arguments: // Sof& sof: (input) sof file object // const String& pname: (input) parameter name // int32 size: (input) size in bytes of object (or FULL_OBJECT) // bool8 param: (input) is the parameter name in the file? // bool8 nested: (input) are we nested? // // return: a bool8 value indicating status // // this method has the object read itself from an Sof file. it assumes // that the Sof file is already positioned correctly. // bool8 SegmentConcat::readData(Sof& sof_a, const String& pname_a, int32 size_a, bool8 param_a, bool8 nested_a) { // declare local variables // bool8 status = true; // declare a SofParser object // SofParser parser; // check if we are nested // if (nested_a) { parser.setNest(); } // load the parse // if (!parser.load(sof_a, size_a)) { // return a warning message // return Error::handle(name(), L"readData", Error::READ, __FILE__, __LINE__, Error::WARNING); } // set the debug level of the parser // parser.setDebug(debug_level_d); // get the algorithm name // if (parser.isPresent(sof_a, PARAM_ALGORITHM)) { if (!ALGO_MAP.readElementData((int32&)algorithm_d, sof_a, PARAM_ALGORITHM, parser.getEntry(sof_a, PARAM_ALGORITHM))) { // return a warning message // return Error::handle(name(), L"readData", Error::READ, __FILE__, __LINE__, Error::WARNING); } } else { algorithm_d = DEF_ALGORITHM; } // get the implementation // if (parser.isPresent(sof_a, PARAM_IMPLEMENTATION)) { if (!IMPL_MAP.readElementData((int32&)implementation_d, sof_a, PARAM_IMPLEMENTATION, parser.getEntry(sof_a, PARAM_IMPLEMENTATION))) { // return a warning message // return Error::handle(name(), L"readData", Error::READ, __FILE__, __LINE__, Error::WARNING); } } else { implementation_d = DEF_IMPLEMENTATION; } // check that all parameters are accounted for // if (!parser.checkParams(sof_a)) { // return a warning message // return Error::handle(name(), L"readData", Error::IO, __FILE__, __LINE__, Error::WARNING); } // exit gracefully // return status; }