// file: $isip/class/sp/FrontEnd/fe_05.cc
// version: $Id: fe_05.cc 10149 2005-06-18 17:10:28Z picone $
//

// isip include files
//
#include "FrontEnd.h"
#include <Filename.h>

// method: load
//
// arguments:
//  const Filename& pfile: (input) parameter file
//
// return: a boolean value indicating status
//
// this method loads a parameter file that configures a front end
//
boolean FrontEnd::load(const Filename& pfile_a) {

  // open the file
  //
  Sof sof;
  if (!sof.open(pfile_a, File::READ_ONLY)) {
    return false;
  }

  // get the object tag:
  //  some tools, such as isip_transform_builder, generate
  //  objects with no tags. other tools might use a different tag no.
  //  therefore, we need to get the tag number first.
  // 
  long tag = sof.first(FrontEnd::name());

  // read the parameters: assume the desired front end is the
  // first tag no. (but not zero).
  //
  if (!read(sof, tag)) {
    return false;
  }

  // close the parameter file
  //
  return sof.close();
}

