DATRW++ library: seismic data I/O with multiple formats

◆ readheader()

void datrw::isustream::readheader ( )
private

Definition at line 120 of file isustream.cc.

References DATRW_assert, DATRW_debug, datrw::Exception::dont_report_on_construct(), datrw::idatstream::good(), datrw::su::SUheader::info(), datrw::idatstream::Mdebug, datrw::idatstream::Mis, Mnextheader, datrw::idatstream::newtrace(), datrw::su::SUheader::read(), datrw::Exception::report(), datrw::Exception::report_on_construct_flag(), datrw::idatstream::setinfo(), datrw::idatstream::setlast(), datrw::idatstream::setwid2(), datrw::idatstream::srce(), datrw::su::SUheader::srce(), and datrw::su::SUheader::wid2().

Referenced by fseries(), and skipseries().

121  {
122  DATRW_debug(Mdebug, "isustream::readheader","entering function");
123  DATRW_assert(this->good(),
124  "ERROR (isustream::readheader): reached end of file");
125  this->newtrace();
126  this->setwid2(Mnextheader.wid2());
127  this->setinfo(Mnextheader.info());
128  DATRW_assert(((this->srce().date == Mnextheader.srce().date)
129  && (this->srce().cs == Mnextheader.srce().cs)
130  && (this->srce().cx == Mnextheader.srce().cx)
131  && (this->srce().cy == Mnextheader.srce().cy)
132  && (this->srce().cz == Mnextheader.srce().cz)),
133  "ERROR (isustream::readheader): "
134  "current source differs from previous");
137  try {
140  {
141  this->setlast();
142  } catch (datrw::Exception E)
143  {
145  E.report();
146  throw(E);
147  }
149  DATRW_debug(Mdebug, "isustream::readheader","leave function");
150  } // void isustream::readheader()
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:92
void setinfo(const sff::INFO &info)
Definition: datread.cc:121
::sff::INFO info() const
return INFO line
Definition: suheader.cc:292
::sff::WID2 wid2() const
return WID2 line
Definition: suheader.cc:309
static bool report_on_construct_flag()
return report on construct flag
Definition: exception.h:93
static void dont_report_on_construct()
Issue NO screen report on construction of exception.
Definition: exception.cc:90
bool good() const
Definition: datread.h:95
Base class for exceptions.
Definition: exception.h:62
std::istream & Mis
Definition: datread.h:126
datrw::su::SUheader Mnextheader
Definition: su.h:91
void setwid2(const sff::WID2 &wid2)
Definition: datread.cc:113
sff::SRCE srce() const
Definition: datread.h:109
#define DATRW_debug(C, N, M)
produce debug output
Definition: debug.h:50
::sff::SRCE srce() const
return SRCE line
Definition: suheader.cc:275
void read(std::istream &is)
read struct from file
Definition: suheader.cc:72
virtual void report() const
Screen report.
Definition: exception.cc:96
Here is the call graph for this function:
Here is the caller graph for this function: