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

◆ swap()

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

swapping must be performed differently for Steim1 and Steim2

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

Definition at line 103 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::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::Mdata, datrw::mseed::SEED::SteimFrame::nwords, SWAPIT, and datrw::mseed::SEED::SteimFrame::FrameData::word.

Referenced by Steim1Frame().

104  {
105  Steim1Word w;
106  SWAPIT(this->Mdata.control);
107  for (int i=0; i<nwords; ++i)
108  {
109  w.fw=this->Mdata.word[i];
110  switch(this->ctrl(i)) {
111  case Fspecial:
112  case Ffw:
113  SWAPIT(w.fw);
114  break;
115  case Fbyte:
116  SWAPIT(w.byte[0]);
117  SWAPIT(w.byte[1]);
118  SWAPIT(w.byte[2]);
119  SWAPIT(w.byte[3]);
120  break;
121  case Fhw:
122  SWAPIT(w.hw[0]);
123  SWAPIT(w.hw[1]);
124  break;
125  default:
126  DATRW_abort("ERROR (Steim1Frame::swap()): illegal code");
127  }
128  this->Mdata.word[i]=w.fw;
129  }
130  } // virtual void Steim1Frame::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
one 32-bit difference (fullword)
Definition: seedstructs.h:472
contains non-data information, like headers
Definition: seedstructs.h:469
static const int nwords
numer of words to process
Definition: seedstructs.h:463
two 16-bit differences (halfword)
Definition: seedstructs.h:471
Here is the call graph for this function:
Here is the caller graph for this function: