37 #define DATRW_SEEDSTRUCTS_CC_VERSION \ 38 "DATRW_SEEDSTRUCTS_CC V1.3" 40 #include<datrwxx/seedstructs.h> 53 #define SWAPIT( A ) A=datrw::util::swap(A) 97 unsigned int code = ((this->
control() >> ((
nwords-i-1)*2)) & 0x03);
107 for (
int i=0; i<
nwords; ++i)
110 switch(this->
ctrl(i)) {
126 DATRW_abort(
"ERROR (Steim1Frame::swap()): illegal code");
138 for (
int i=0; i<
nwords; ++i)
141 switch(this->
ctrl(i)) {
154 DATRW_abort(
"ERROR (Steim2Frame::swap()): illegal code");
187 switch(this->
ctrl()) {
201 DATRW_abort(
"ERROR (Steim1Frame::setn()): illegal code");
214 switch(this->
ctrl()) {
219 retval=int(w.
byte[this->idiff()]);
228 DATRW_abort(
"ERROR (Steim1Reader::diff()): illegal code");
262 return(
int((
Mword >> 30) & 0x03));
278 switch (this->
dnib()) {
290 "illegal decode nibble");
294 switch (this->
dnib()) {
306 "illegal decode nibble");
310 DATRW_abort(
"ERROR (Steim2Word::value): illegal ctrl code");
321 "ERROR (Steim2Word::value): " 322 "illegal value index");
336 switch (this->
dnib()) {
341 retval=this->
extract(15,nval-i);
344 retval=this->
extract(10,nval-i);
348 "illegal decode nibble");
352 switch (this->
dnib()) {
354 retval=this->
extract(6,nval-i);
357 retval=this->
extract(5,nval-i);
360 retval=this->
extract(4,nval-i);
364 "illegal decode nibble");
368 DATRW_abort(
"ERROR (Steim2Word::value): illegal ctrl code");
378 "use at least 1 byte");
381 DATRW_assert((p<
int(32/b)),
"ERROR (Steim2Word::extract): " 383 int signmask=int(1 << (b-1));
384 int valmask=signmask - 1;
387 int sign=int((
Mword >> nshift) & signmask);
391 int retval= sign ? (
value | ~valmask) :
value;
int idiff() const
return current difference index
virtual void swap()
swapping must be performed differently for Steim1 and Steim2
int fw
1 4-byte difference (fullword)
unsigned short int tmilsec
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
virtual void swap()
swapping must be performed differently for Steim1 and Steim2
virtual int diff() const
return current difference value
int nval() const
return number of values in this word
void reset()
step to first difference value
unsigned int control() const
return control word
virtual void setn()
set Mn for current word (compression type specific)
SteimFrame::ESteimControl ctrl() const
return control code for current word
unsigned int control
control flags
int word[nwords]
data buffer
int dnib() const
return dnib
ESteimControl
possible control codes
four 8-bit differences (byte)
short int hw[2]
2 2-byte differences (halfword)
exception class declaration for libdatrwxx (prototypes)
FrameData Mdata
frame data (swapped)
A copy of bytesex.h from libtfxx (prototypes)
Root namespace of library.
four 8-bit differences (byte)
DataRecordBlocketteHeader blocketteheader
virtual void setn()
set Mn for current word (compression type specific)
DataRecordBlocketteHeader blocketteheader
#define DATRW_abort(M)
Abort and give a message.
one 32-bit difference (fullword)
contains non-data information, like headers
virtual void setn()=0
set Mn for current word (compression type specific)
int Mn
number of differences in this word
int Miword
current word in frame
int extract(const int &b, const int &p) const
contains non-data information, like headers
void next()
step to next difference value
virtual int diff() const
return current difference value
bool Mvalid
we are still inside the current frame
bool valid() const
we are still inside the frame
int Midiff
current difference value in word
static const int nwords
numer of words to process
int word() const
return current data word
char byte[4]
4 1-byte differences
int value(const int &i) const
two 16-bit differences (halfword)