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

◆ swap()

void datrw::mseed::SEED::Steim2Frame::swap ( )
virtual

swapping must be performed differently for Steim1 and Steim2

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

Definition at line 134 of file seedstructs.cc.

References datrw::mseed::SEED::Steim1Word::byte, datrw::mseed::SEED::SteimFrame::FrameData::control, datrw::mseed::SEED::SteimFrame::ctrl(), DATRW_abort, datrw::mseed::SEED::SteimFrame::Fbyte, datrw::mseed::SEED::SteimFrame::Fdnib1, datrw::mseed::SEED::SteimFrame::Fdnib2, datrw::mseed::SEED::SteimFrame::Fspecial, datrw::mseed::SEED::Steim1Word::fw, datrw::mseed::SEED::SteimFrame::Mdata, datrw::mseed::SEED::SteimFrame::nwords, SWAPIT, and datrw::mseed::SEED::SteimFrame::FrameData::word.

Referenced by Steim2Frame().

135  {
136  Steim1Word w;
137  SWAPIT(this->Mdata.control);
138  for (int i=0; i<nwords; ++i)
139  {
140  w.fw=this->Mdata.word[i];
141  switch(this->ctrl(i)) {
142  case Fspecial:
143  case Fdnib1:
144  case Fdnib2:
145  SWAPIT(w.fw);
146  break;
147  case Fbyte:
148  SWAPIT(w.byte[0]);
149  SWAPIT(w.byte[1]);
150  SWAPIT(w.byte[2]);
151  SWAPIT(w.byte[3]);
152  break;
153  default:
154  DATRW_abort("ERROR (Steim2Frame::swap()): illegal code");
155  }
156  this->Mdata.word[i]=w.fw;
157  }
158  } // virtual void Steim2Frame::swap()
SteimFrame::ESteimControl ctrl() const
return control code for current word
Definition: seedstructs.h:508
unsigned int control
control flags
Definition: seedstructs.h:482
#define SWAPIT(A)
Definition: seedstructs.cc:53
FrameData Mdata
frame data (swapped)
Definition: seedstructs.h:528
four 8-bit differences (byte)
Definition: seedstructs.h:470
#define DATRW_abort(M)
Abort and give a message.
Definition: error.h:101
contains non-data information, like headers
Definition: seedstructs.h:469
static const int nwords
numer of words to process
Definition: seedstructs.h:463
Here is the call graph for this function:
Here is the caller graph for this function: