Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

DCFmpBase Class Reference

#include <DCFmpBase.h>

Inheritance diagram for DCFmpBase:

Inheritance graph
[legend]
Collaboration diagram for DCFmpBase:

Collaboration graph
[legend]

Public Member Functions

int arraydim ()
int bplen_a ()
int bplen_coef ()
int bplen_mpsizeb ()
int bplen_n ()
virtual void clear ()
 DCFmpBase (const int bplen_mpsizeb, const int bplen_coef, const int bplen_n)
 DCFmpBase (const int bplen_mpsizeb, const int bplen_coef, const int bplen_n, const int bplen_a)
bool empty ()
int m ()
char mcode ()
int mcode_to_m (const char)
int mcode_to_order (const char)
int mcode_to_rs (const char)
int mcode_to_sw (const char)
int mpsizeb ()
int n ()
bool null ()
int order ()
virtual void push_back (bytepack &)
virtual void push_back (const char)
void read (istream &is)
int rs ()
virtual void set (void *)
virtual void set ()
virtual void set (const int n)
virtual void set (const char mcode)
virtual void set (const char mcode, const int n)
virtual void set (const int bplen_mpsizeb, const int bplen_coef, const int bplen_n)
virtual void set (const int bplen_mpsizeb, const int bplen_coef, const int bplen_n, const int bplen_a)
int sw ()
void write (ostream &os)
 ~DCFmpBase ()

Protected Attributes

int _arraydim
int _bplen_a
int _bplen_coef
int _bplen_mpsizeb
int _bplen_n
vector< char > * _data
char _mcode
int _mpsizeb
int _n
bool _null

Private Member Functions

 DCFmpBase ()

Friends

ostream & operator<< (ostream &, DCFmpBase &)
istream & operator>> (istream &, DCFmpBase &)

Constructor & Destructor Documentation

DCFmpBase::DCFmpBase const int  bplen_mpsizeb,
const int  bplen_coef,
const int  bplen_n,
const int  bplen_a
 

Definition at line 16 of file DCFmpBase.cpp.

References _data.

00020   : _arraydim(1),
00021     _bplen_mpsizeb(bplen_mpsizeb), _bplen_coef(bplen_coef),
00022     _bplen_n(bplen_n), _bplen_a(bplen_a),
00023     _mcode(0), _null(1)
00024 {
00025    _n = -1;
00026    _data = new vector<char>;
00027 }

DCFmpBase::DCFmpBase const int  bplen_mpsizeb,
const int  bplen_coef,
const int  bplen_n
 

Definition at line 29 of file DCFmpBase.cpp.

References _data.

00033   : _arraydim(0),
00034     _bplen_mpsizeb(bplen_mpsizeb), _bplen_coef(bplen_coef),
00035     _bplen_n(bplen_n),
00036     _mcode(0), _null(1)
00037 {
00038    _n = -1;
00039    _data = new vector<char>;
00040 }

DCFmpBase::~DCFmpBase  ) 
 

Definition at line 42 of file DCFmpBase.cpp.

References _data.

00043 { 
00044    if ( _data ) { delete _data; _data = 0; } 
00045 }

DCFmpBase.DCFmpBase  )  [private]
 

Definition at line 97 of file DCFmpBase.h.

00097 {}


Member Function Documentation

int DCFmpBase.arraydim  ) 
 

Definition at line 60 of file DCFmpBase.h.

References _arraydim.

00060 { return _arraydim; }

int DCFmpBase.bplen_a  ) 
 

Definition at line 64 of file DCFmpBase.h.

00064 { return _bplen_a; }

int DCFmpBase.bplen_coef  ) 
 

Definition at line 62 of file DCFmpBase.h.

00062 {  return _bplen_coef; }

int DCFmpBase.bplen_mpsizeb  ) 
 

Definition at line 61 of file DCFmpBase.h.

References _bplen_mpsizeb.

00061 { return _bplen_mpsizeb; }

int DCFmpBase.bplen_n  ) 
 

Definition at line 63 of file DCFmpBase.h.

00063 { return _bplen_n; }

void DCFmpBase::clear  )  [virtual]
 

Definition at line 136 of file DCFmpBase.h.

References _data.

Referenced by DCFsbifstream< Data_t >.findmpacket(), and read().

00137 {
00138    if ( _data != 0 ) { delete _data; _data = 0; } 
00139    _data = new vector<char>;
00140 }

bool DCFmpBase::empty  ) 
 

Definition at line 155 of file DCFmpBase.h.

Referenced by DCFsbifstream< Data_t >.findmpacket(), and write().

00155 { return ( (*_data).size() == 0 ); }

int DCFmpBase::m  ) 
 

Definition at line 161 of file DCFmpBase.h.

References mcode_to_m().

00161 { return mcode_to_m( _mcode ); }

char DCFmpBase::mcode  ) 
 

Definition at line 158 of file DCFmpBase.h.

00158 { return _mcode; };

int DCFmpBase::mcode_to_m const  char  ) 
 

Definition at line 176 of file DCFmpBase.h.

Referenced by m().

00177 { 
00178    return int( (unsigned char)( 0x1F & mcode ) ); 
00179 };

int DCFmpBase::mcode_to_order const  char  ) 
 

Definition at line 194 of file DCFmpBase.h.

Referenced by order().

00195 { 
00196    return int( (unsigned char)( ( 0x20 & mcode ) >> 5 ) ); 
00197 };

int DCFmpBase::mcode_to_rs const  char  ) 
 

Definition at line 188 of file DCFmpBase.h.

Referenced by rs().

00189 { 
00190    return ( ( 0x40 & mcode ) >> 6 ); 
00191 };

int DCFmpBase::mcode_to_sw const  char  ) 
 

Definition at line 182 of file DCFmpBase.h.

Referenced by sw().

00183 { 
00184    return int( (unsigned char)( ( 0x80 & mcode ) >> 7 ) ); 
00185 };

int DCFmpBase::mpsizeb  ) 
 

Definition at line 80 of file DCFmpBase.cpp.

References _bplen_mpsizeb, and _null.

Referenced by write().

00081 {
00082    if ( _null ) return 0;
00083    else return 2*_bplen_mpsizeb + 1 + _bplen_n + (*_data).size();
00084 }

int DCFmpBase::n  ) 
 

Definition at line 173 of file DCFmpBase.h.

00173 { return _n; };

bool DCFmpBase::null  ) 
 

Definition at line 152 of file DCFmpBase.h.

References _null.

00152 { return _null; }

int DCFmpBase::order  ) 
 

Definition at line 170 of file DCFmpBase.h.

References mcode_to_order().

00170 { return mcode_to_order( _mcode ); }

void DCFmpBase::push_back bytepack  )  [virtual]
 

Definition at line 146 of file DCFmpBase.h.

References bytepack.size().

00147 { 
00148    for( int i = 0; i < bp.size(); i++ ) { (*_data).push_back(bp[i]); }
00149 }

void DCFmpBase::push_back const  char  )  [virtual]
 

Definition at line 143 of file DCFmpBase.h.

Referenced by read().

00143 { (*_data).push_back(c); };

void DCFmpBase::read istream &  is  ) 
 

Definition at line 102 of file DCFmpBase.cpp.

References _bplen_mpsizeb, _null, clear(), and push_back().

Referenced by operator>>().

00103 {
00104    clear();
00105    if ( is.good() ) {
00106       char c;
00107       bytepack bp;
00108       is >> bp( 0, _bplen_mpsizeb ); int sizeb = int(bp);
00109       if ( sizeb != 0 ) {
00110          _null = 0;
00111          is >> bp(0,1); _mcode = char(bp);
00112          is >> bp( 0, _bplen_n ); _n = int(bp);
00113          for( int i = 0; i < (sizeb - 2*_bplen_mpsizeb - 1 - _bplen_n); i++ ) {
00114             is.get(c); 
00115             push_back(c);
00116          }
00117          is >> bp( 0, _bplen_mpsizeb ); int tmp = int(bp);
00118          if ( tmp != sizeb ) {
00119             _null = 1;
00120 #ifdef STORM_DEBUG
00121             cout << "DCFmpBase::read(istream&): "
00122                  << "ERROR: read inconsistent mpsizeb"
00123                  << sizeb << ' ' << tmp << endl;
00124 #endif
00125          }
00126       }
00127       else { _null = 1; }
00128    }
00129 };

int DCFmpBase::rs  ) 
 

Definition at line 167 of file DCFmpBase.h.

References mcode_to_rs().

00167 { return mcode_to_rs( _mcode ); }

void DCFmpBase::set void *   )  [virtual]
 

Definition at line 133 of file DCFmpBase.h.

References _null.

00133 { _null = 1; }

void DCFmpBase::set  )  [virtual]
 

Definition at line 130 of file DCFmpBase.h.

References _null.

Referenced by set().

00130 { _null = 0; }

void DCFmpBase::set const int  n  )  [virtual]
 

Definition at line 115 of file DCFmpBase.h.

References _null.

00116 { 
00117   _n = n; 
00118   _null = 0;
00119 }

void DCFmpBase::set const char  mcode  )  [virtual]
 

Definition at line 108 of file DCFmpBase.h.

References _null.

00109 { 
00110    _mcode = mcode; 
00111    _null = 0;
00112 }

void DCFmpBase::set const char  mcode,
const int  n
[virtual]
 

Definition at line 122 of file DCFmpBase.h.

References _null, and set().

00123 {
00124    set(mcode);
00125    set(n);
00126   _null = 0;
00127 }

void DCFmpBase::set const int  bplen_mpsizeb,
const int  bplen_coef,
const int  bplen_n
[virtual]
 

Definition at line 64 of file DCFmpBase.cpp.

References _arraydim, _bplen_mpsizeb, _data, and _null.

00068 {
00069    _arraydim = 0;
00070    _bplen_mpsizeb = bplen_mpsizeb;
00071    _bplen_coef = bplen_coef;
00072    _mcode = 0;
00073    _bplen_n = bplen_n;
00074    _n = -1;
00075    if ( _data ) { delete [] _data; _data = 0; } 
00076    _data = new vector<char>;
00077    _null = 1;
00078 }

void DCFmpBase::set const int  bplen_mpsizeb,
const int  bplen_coef,
const int  bplen_n,
const int  bplen_a
[virtual]
 

Definition at line 47 of file DCFmpBase.cpp.

References _arraydim, _bplen_mpsizeb, _data, and _null.

Referenced by DCFsbistream< Rtmra_t >.operator>>().

00051 {
00052    _arraydim = 1;
00053    _bplen_mpsizeb = bplen_mpsizeb;
00054    _bplen_coef = bplen_coef;
00055    _mcode = 0;
00056    _bplen_n = bplen_n;
00057    _bplen_a = bplen_a;
00058    _n = -1;
00059    if ( _data ) { delete _data; _data = 0; } 
00060    _data = new vector<char>;
00061    _null = 1;
00062 }

int DCFmpBase::sw  ) 
 

Definition at line 164 of file DCFmpBase.h.

References mcode_to_sw().

00164 { return mcode_to_sw( _mcode ); }

void DCFmpBase::write ostream &  os  ) 
 

Definition at line 87 of file DCFmpBase.cpp.

References _bplen_mpsizeb, _data, empty(), and mpsizeb().

Referenced by operator<<().

00088 {
00089    bytepack bp;
00090    if ( !empty() && os.good() ) {
00091       os << bp( mpsizeb(), _bplen_mpsizeb );
00092       os << bp( _mcode, 1 );
00093       os << bp( _n, _bplen_n );
00094       for( int i = 0; i < (*_data).size(); i++ ) os.put( (*_data)[i] ); 
00095       os << bp( mpsizeb(), _bplen_mpsizeb );
00096 #ifdef STORM_DEBUG
00097            cout << "DCFmpBase::write(): mpsizeb() " << mpsizeb() << endl;
00098 #endif
00099    }
00100 }


Friends And Related Function Documentation

ostream& operator<< ostream &  os,
DCFmpBase mp
[friend]
 

Definition at line 131 of file DCFmpBase.cpp.

00132 {
00133    mp.write(os);
00134    return os;
00135 };

istream& operator>> istream &  is,
DCFmpBase mp
[friend]
 

Definition at line 137 of file DCFmpBase.cpp.

00138 {
00139    mp.read(is);
00140    return is;
00141 };


Field Documentation

int DCFmpBase._arraydim [protected]
 

Definition at line 81 of file DCFmpBase.h.

Referenced by arraydim(), and set().

int DCFmpBase._bplen_a [protected]
 

Definition at line 85 of file DCFmpBase.h.

int DCFmpBase._bplen_coef [protected]
 

Definition at line 83 of file DCFmpBase.h.

int DCFmpBase._bplen_mpsizeb [protected]
 

Definition at line 82 of file DCFmpBase.h.

Referenced by bplen_mpsizeb(), mpsizeb(), read(), set(), and write().

int DCFmpBase._bplen_n [protected]
 

Definition at line 84 of file DCFmpBase.h.

vector<char>* DCFmpBase._data [protected]
 

Definition at line 92 of file DCFmpBase.h.

Referenced by clear(), DCFmpBase(), set(), write(), and ~DCFmpBase().

char DCFmpBase._mcode [protected]
 

Definition at line 89 of file DCFmpBase.h.

int DCFmpBase._mpsizeb [protected]
 

Definition at line 87 of file DCFmpBase.h.

int DCFmpBase._n [protected]
 

Definition at line 90 of file DCFmpBase.h.

bool DCFmpBase._null [protected]
 

Definition at line 94 of file DCFmpBase.h.

Referenced by mpsizeb(), null(), read(), and set().


The documentation for this class was generated from the following files:
Generated on Mon May 31 21:41:00 2004 for SR2k4 Assembler by doxygen 1.3.6