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

◆ diff()

int datrw::mseed::SEED::Steim1Frame::diff ( ) const
virtual

return current difference value

Implements datrw::mseed::SEED::SteimFrame.

Definition at line 207 of file seedstructs.cc.

References datrw::mseed::SEED::Steim1Word::byte, datrw::mseed::SEED::SteimFrame::ctrl(), DATRW_abort, datrw::mseed::SEED::SteimFrame::Fbyte, datrw::mseed::SEED::SteimFrame::Ffw, datrw::mseed::SEED::SteimFrame::Fhw, datrw::mseed::SEED::SteimFrame::Fspecial, datrw::mseed::SEED::Steim1Word::fw, datrw::mseed::SEED::Steim1Word::hw, datrw::mseed::SEED::SteimFrame::idiff(), datrw::mseed::SEED::SteimFrame::valid(), and datrw::mseed::SEED::SteimFrame::word().

208  {
209  int retval=0;
210  Steim1Word w;
211  w.fw=this->word();
212  if (this->valid())
213  {
214  switch(this->ctrl()) {
216  retval=w.fw;
217  break;
218  case SteimFrame::Fbyte:
219  retval=int(w.byte[this->idiff()]);
220  break;
221  case SteimFrame::Fhw:
222  retval=w.hw[this->idiff()];
223  break;
224  case SteimFrame::Ffw:
225  retval=w.fw;
226  break;
227  default:
228  DATRW_abort("ERROR (Steim1Reader::diff()): illegal code");
229  }
230  }
231  // std::cout << " ** diff is " << retval << std::endl;
232  return(retval);
233  } // int Steim1Frame::diff()
int idiff() const
return current difference index
Definition: seedstructs.h:517
SteimFrame::ESteimControl ctrl() const
return control code for current word
Definition: seedstructs.h:508
four 8-bit differences (byte)
Definition: seedstructs.h:470
#define DATRW_abort(M)
Abort and give a message.
Definition: error.h:101
one 32-bit difference (fullword)
Definition: seedstructs.h:472
contains non-data information, like headers
Definition: seedstructs.h:469
bool valid() const
we are still inside the frame
Definition: seedstructs.h:506
int word() const
return current data word
Definition: seedstructs.h:496
two 16-bit differences (halfword)
Definition: seedstructs.h:471
Here is the call graph for this function: