SFF++ library: reading and writing SFF from C++

◆ read()

template<class C >
void sff::InputWaveform< C >::read ( std::istream &  is)
inline

Definition at line 460 of file sffxx.h.

Referenced by sff::InputWaveform< C >::InputWaveform(), and sff::operator>>().

461  {
462  typedef typename C::Tvalue Tvalue;
463  if (Mdebug)
464  {
465  std::cerr << "DEBUG (InputWaveform<C>::read): " << std::endl
466  << " calling function readheader() of member Mheader."
467  << std::endl;
468  }
470  Mheader.readheader(is);
471  int nsamples=Mheader.wid2().nsamples;
472  GSE2::waveform::TDAT2readCM6 freader(nsamples);
473  try {
474  Mseries=C(nsamples);
475  }
476  catch(...) {
477  std::cerr << "ERROR (InputWaveform::read): "
478  << "allocating series for " << nsamples << " samples!" << std::endl;
479  throw;
480  }
481  for(aff::Iterator<C> i(Mseries); i.valid(); ++i)
482  { (*i) = Tvalue(freader(is)*Mheader.dast().ampfac); }
483  Mheader.readtrailer(is);
484  Mvalid=true;
485  } // InputWaveform::read
TraceHeader Mheader
Definition: sffxx.h:361
int nsamples
number of samples
Definition: sffxx.h:219
const WID2 & wid2() const
Definition: sffxx.h:305
double ampfac
Definition: sffxx.h:187
void readtrailer(std::istream &)
Definition: sffxx.cc:885
Tcontainer Mseries
Definition: sffxx.h:360
void setdebug(const bool &flag)
Definition: sffxx.h:313
void readheader(std::istream &)
Definition: sffxx.cc:875
const DAST & dast() const
Definition: sffxx.h:306
Here is the caller graph for this function: