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

MCFmpBase Class Reference

#include <MCFmpBase.h>

Inheritance diagram for MCFmpBase:

Inheritance graph
[legend]
Collaboration diagram for MCFmpBase:

Collaboration graph
[legend]

Public Member Functions

int arraydim ()
int bplen_a ()
int bplen_coef ()
int bplen_mpsizeb ()
int bplen_n ()
virtual void clear ()
bool empty ()
int m ()
 MCFmpBase (const int bplen_mpsizeb, const int bplen_coef, const int bplen_n)
 MCFmpBase (const int bplen_mpsizeb, const int bplen_coef, const int bplen_n, const int bplen_a)
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)
virtual ~MCFmpBase ()

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

 MCFmpBase ()

Friends

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

Constructor & Destructor Documentation

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

Definition at line 16 of file MCFmpBase.cpp.

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 }

MCFmpBase::MCFmpBase const int  bplen_mpsizeb,
const int  bplen_coef,
const int  bplen_n
 

Definition at line 29 of file MCFmpBase.cpp.

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 }

MCFmpBase::~MCFmpBase  )  [virtual]
 

Definition at line 42 of file MCFmpBase.cpp.

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

MCFmpBase.MCFmpBase  )  [private]
 

Definition at line 97 of file MCFmpBase.h.

00097 {}


Member Function Documentation

int MCFmpBase.arraydim  ) 
 

Definition at line 60 of file MCFmpBase.h.

00060 { return _arraydim; }

int MCFmpBase.bplen_a  ) 
 

Definition at line 64 of file MCFmpBase.h.

00064 { return _bplen_a; }

int MCFmpBase.bplen_coef  ) 
 

Definition at line 62 of file MCFmpBase.h.

00062 {  return _bplen_coef; }

int MCFmpBase.bplen_mpsizeb  ) 
 

Definition at line 61 of file MCFmpBase.h.

00061 { return _bplen_mpsizeb; }

int MCFmpBase.bplen_n  ) 
 

Definition at line 63 of file MCFmpBase.h.

00063 { return _bplen_n; }

void MCFmpBase::clear  )  [virtual]
 

Definition at line 136 of file MCFmpBase.h.

Referenced by MCFsbifstream< Rtmra_t >.findmpacket(), and read().

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

bool MCFmpBase::empty  ) 
 

Definition at line 155 of file MCFmpBase.h.

Referenced by MCFsbifstream< Rtmra_t >.findmpacket(), and write().

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

int MCFmpBase::m  ) 
 

Definition at line 161 of file MCFmpBase.h.

References mcode_to_m().

00161 { return mcode_to_m( _mcode ); }

char MCFmpBase::mcode  ) 
 

Definition at line 158 of file MCFmpBase.h.

00158 { return _mcode; };

int MCFmpBase::mcode_to_m const  char  ) 
 

Definition at line 176 of file MCFmpBase.h.

Referenced by m().

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

int MCFmpBase::mcode_to_order const  char  ) 
 

Definition at line 194 of file MCFmpBase.h.

Referenced by order().

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

int MCFmpBase::mcode_to_rs const  char  ) 
 

Definition at line 188 of file MCFmpBase.h.

Referenced by rs().

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

int MCFmpBase::mcode_to_sw const  char  ) 
 

Definition at line 182 of file MCFmpBase.h.

Referenced by sw().

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

int MCFmpBase::mpsizeb  ) 
 

Definition at line 80 of file MCFmpBase.cpp.

Referenced by write().

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

int MCFmpBase::n  ) 
 

Definition at line 173 of file MCFmpBase.h.

00173 { return _n; };

bool MCFmpBase::null  ) 
 

Definition at line 152 of file MCFmpBase.h.

00152 { return _null; }

int MCFmpBase::order  ) 
 

Definition at line 170 of file MCFmpBase.h.

References mcode_to_order().

00170 { return mcode_to_order( _mcode ); }

void MCFmpBase::push_back bytepack  )  [virtual]
 

Definition at line 146 of file MCFmpBase.h.

References bytepack.size().

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

void MCFmpBase::push_back const  char  )  [virtual]
 

Definition at line 143 of file MCFmpBase.h.

Referenced by read().

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

void MCFmpBase::read istream &  is  ) 
 

Definition at line 103 of file MCFmpBase.cpp.

References clear(), and push_back().

Referenced by operator>>().

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

int MCFmpBase::rs  ) 
 

Definition at line 167 of file MCFmpBase.h.

References mcode_to_rs().

00167 { return mcode_to_rs( _mcode ); }

void MCFmpBase::set void *   )  [virtual]
 

Definition at line 133 of file MCFmpBase.h.

00133 { _null = 1; }

void MCFmpBase::set  )  [virtual]
 

Definition at line 130 of file MCFmpBase.h.

Referenced by set().

00130 { _null = 0; }

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

Definition at line 115 of file MCFmpBase.h.

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

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

Definition at line 108 of file MCFmpBase.h.

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

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

Definition at line 122 of file MCFmpBase.h.

References set().

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

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

Definition at line 64 of file MCFmpBase.cpp.

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 MCFmpBase::set const int  bplen_mpsizeb,
const int  bplen_coef,
const int  bplen_n,
const int  bplen_a
[virtual]
 

Definition at line 47 of file MCFmpBase.cpp.

Referenced by MCFsbistream< Rtmra_t >.jump_read(), and MCFsbistream< 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 MCFmpBase::sw  ) 
 

Definition at line 164 of file MCFmpBase.h.

References mcode_to_sw().

00164 { return mcode_to_sw( _mcode ); }

void MCFmpBase::write ostream &  os  ) 
 

Definition at line 87 of file MCFmpBase.cpp.

References 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 < (int)(*_data).size(); i++ ) os.put( (*_data)[i] ); 
00095       for( int i = 0; i < (int)_data->size(); i++ ) os.put( (*_data)[i] ); 
00096       os << bp( mpsizeb(), _bplen_mpsizeb );
00097 #ifdef STORM_DEBUG
00098            cout << "MCFmpBase::write(): mpsizeb() " << mpsizeb() << endl;
00099 #endif
00100    }
00101 }


Friends And Related Function Documentation

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

Definition at line 132 of file MCFmpBase.cpp.

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

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

Definition at line 138 of file MCFmpBase.cpp.

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


Field Documentation

int MCFmpBase._arraydim [protected]
 

Definition at line 81 of file MCFmpBase.h.

int MCFmpBase._bplen_a [protected]
 

Definition at line 85 of file MCFmpBase.h.

int MCFmpBase._bplen_coef [protected]
 

Definition at line 83 of file MCFmpBase.h.

int MCFmpBase._bplen_mpsizeb [protected]
 

Definition at line 82 of file MCFmpBase.h.

int MCFmpBase._bplen_n [protected]
 

Definition at line 84 of file MCFmpBase.h.

vector<char>* MCFmpBase._data [protected]
 

Definition at line 92 of file MCFmpBase.h.

char MCFmpBase._mcode [protected]
 

Definition at line 89 of file MCFmpBase.h.

int MCFmpBase._mpsizeb [protected]
 

Definition at line 87 of file MCFmpBase.h.

int MCFmpBase._n [protected]
 

Definition at line 90 of file MCFmpBase.h.

bool MCFmpBase._null [protected]
 

Definition at line 94 of file MCFmpBase.h.


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