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

DCFmpacketBase Class Reference

#include <DCFmpacketBase.h>

Inheritance diagram for DCFmpacketBase:

Inheritance graph
[legend]
Collaboration diagram for DCFmpacketBase:

Collaboration graph
[legend]

Public Member Functions

int bplen_n ()
void bplen_n (const int)
int bplen_sizeb ()
void bplen_sizeb (const int)
virtual void clear ()
 DCFmpacketBase (const int sizebmax=0, const int bplen_sizeb=1, const int bplen_n=1)
bool empty ()
int m (const char)
int m ()
char mcode ()
char * mpacket ()
int n ()
int order (const char)
int order ()
virtual void put (bytepack &)
virtual void put (const char)
virtual void reset ()
int rs (const char)
int rs ()
virtual void set (const char, const int)
virtual void set (const char)
virtual void setencode (const int, const int, const int)
int sizeb ()
int sw (const char)
int sw ()
 ~DCFmpacketBase ()

Protected Attributes

int _bplen_n
int _bplen_sizeb
char _mcode
int _n
char * _ptmpacket
int _sizeb
int _sizebmax

Friends

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

Constructor & Destructor Documentation

DCFmpacketBase::DCFmpacketBase const int  sizebmax = 0,
const int  bplen_sizeb = 1,
const int  bplen_n = 1
 

Definition at line 70 of file DCFmpacketBase.h.

References _ptmpacket, and _sizebmax.

00074   : _sizebmax(sizebmax), _sizeb(0), _mcode(0), _n(-1), 
00075     _bplen_sizeb(bplen_sizeb), _bplen_n(bplen_n)
00076 {
00077    _ptmpacket = new char[ _sizebmax ];
00078 };

DCFmpacketBase::~DCFmpacketBase  ) 
 

Definition at line 81 of file DCFmpacketBase.h.

References _ptmpacket.

00082 { 
00083   if ( _ptmpacket ) { delete [] _ptmpacket; _ptmpacket = 0; }
00084 };


Member Function Documentation

int DCFmpacketBase::bplen_n  ) 
 

Definition at line 186 of file DCFmpacketBase.h.

References _bplen_n.

Referenced by setencode().

00186 { return _bplen_n; };

void DCFmpacketBase::bplen_n const  int  ) 
 

Definition at line 183 of file DCFmpacketBase.h.

References _bplen_n.

00183 { _bplen_n = bplen_n; };

int DCFmpacketBase::bplen_sizeb  ) 
 

Definition at line 180 of file DCFmpacketBase.h.

References _bplen_sizeb.

Referenced by setencode().

00180 { return _bplen_sizeb; };

void DCFmpacketBase::bplen_sizeb const  int  ) 
 

Definition at line 174 of file DCFmpacketBase.h.

References _bplen_sizeb.

00175 {
00176    _bplen_sizeb = bplen_sizeb; 
00177 };

void DCFmpacketBase::clear  )  [virtual]
 

Definition at line 98 of file DCFmpacketBase.h.

References reset(), and set().

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

00098                            {
00099    reset();
00100    set( 0, -1);
00101 };

bool DCFmpacketBase::empty  ) 
 

Definition at line 195 of file DCFmpacketBase.h.

References _sizeb.

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

00195 { return ( _sizeb == 0 ); }

int DCFmpacketBase::m const  char  ) 
 

Definition at line 123 of file DCFmpacketBase.h.

00124 { 
00125    return int( (unsigned char)( 0x1F & mcode ) ); 
00126 };

int DCFmpacketBase::m  ) 
 

Definition at line 129 of file DCFmpacketBase.h.

References _mcode.

00130 { 
00131    return int( (unsigned char)( 0x1F & _mcode ) ); 
00132 };

char DCFmpacketBase::mcode  ) 
 

Definition at line 120 of file DCFmpacketBase.h.

References _mcode.

00120 { return _mcode; };

char * DCFmpacketBase::mpacket  ) 
 

Definition at line 192 of file DCFmpacketBase.h.

References _ptmpacket.

00192 { return _ptmpacket; }

int DCFmpacketBase::n  ) 
 

Definition at line 171 of file DCFmpacketBase.h.

References _n.

00171 { return _n; };

int DCFmpacketBase::order const  char  ) 
 

Definition at line 159 of file DCFmpacketBase.h.

00160 { 
00161    return int( (unsigned char)( ( 0x20 & mcode ) >> 5 ) ); 
00162 };

int DCFmpacketBase::order  ) 
 

Definition at line 165 of file DCFmpacketBase.h.

References _mcode.

00166 { 
00167    return int( (unsigned char)( ( 0x20 & _mcode ) >> 5 ) ); 
00168 };

void DCFmpacketBase::put bytepack  )  [virtual]
 

Definition at line 16 of file DCFmpacketBase.cpp.

References _ptmpacket, _sizeb, and bytepack.size().

00017 { 
00018    for( int i = 0; i < bp.size(); i++ ) { _ptmpacket[ _sizeb++ ] = bp[i]; }
00019 };

void DCFmpacketBase::put const  char  )  [virtual]
 

Definition at line 189 of file DCFmpacketBase.h.

References _ptmpacket, and _sizeb.

00189 { _ptmpacket[ _sizeb++ ] = c; };

void DCFmpacketBase::reset  )  [virtual]
 

Definition at line 104 of file DCFmpacketBase.h.

References _sizeb.

Referenced by clear().

00104 { _sizeb=0; };

int DCFmpacketBase::rs const  char  ) 
 

Definition at line 147 of file DCFmpacketBase.h.

00148 { 
00149    return ( ( 0x40 & mcode ) >> 6 ); 
00150 };

int DCFmpacketBase::rs  ) 
 

Definition at line 153 of file DCFmpacketBase.h.

References _mcode.

00154 { 
00155    return int( (unsigned char)( ( 0x40 & _mcode ) >> 6 ) ); 
00156 };

void DCFmpacketBase::set const  char,
const  int
[virtual]
 

Definition at line 110 of file DCFmpacketBase.h.

References _n, and set().

00111 {
00112    set(mcode);
00113    _n=n;
00114 } 

void DCFmpacketBase::set const  char  )  [virtual]
 

Definition at line 107 of file DCFmpacketBase.h.

References _mcode.

Referenced by clear(), and set().

00107 { _mcode=mcode; } 

void DCFmpacketBase::setencode const  int,
const  int,
const  int
[virtual]
 

Reimplemented in DCFmpacket< Rtmra< double, array > >, DCFmpacket< Rtmra< double, scalar > >, DCFmpacket< Rtmra< float, array > >, DCFmpacket< Rtmra< float, scalar > >, DCFmpacket< Rtrsmra< double, array > >, DCFmpacket< Rtrsmra< double, scalar > >, DCFmpacket< Rtrsmra< float, array > >, and DCFmpacket< Rtrsmra< float, scalar > >.

Definition at line 87 of file DCFmpacketBase.h.

References _ptmpacket, bplen_n(), and bplen_sizeb().

Referenced by DCFsbistream< Data_t >.operator>>(), DCFmpacket< Rtrsmra< float, scalar > >.setencode(), DCFmpacket< Rtrsmra< float, array > >.setencode(), DCFmpacket< Rtrsmra< double, scalar > >.setencode(), DCFmpacket< Rtrsmra< double, array > >.setencode(), DCFmpacket< Rtmra< float, scalar > >.setencode(), DCFmpacket< Rtmra< float, array > >.setencode(), DCFmpacket< Rtmra< double, scalar > >.setencode(), and DCFmpacket< Rtmra< double, array > >.setencode().

00091 {
00092    bplen_sizeb(bplensizeb);
00093    bplen_n(bplenn);
00094    _ptmpacket = new char[sizebmax];
00095 };

int DCFmpacketBase::sizeb  ) 
 

Definition at line 117 of file DCFmpacketBase.h.

References _sizeb.

00117 { return _sizeb; };

int DCFmpacketBase::sw const  char  ) 
 

Definition at line 135 of file DCFmpacketBase.h.

00136 { 
00137    return int( (unsigned char)( ( 0x80 & mcode ) >> 7 ) ); 
00138 };

int DCFmpacketBase::sw  ) 
 

Definition at line 141 of file DCFmpacketBase.h.

References _mcode.

00142 { 
00143    return int( (unsigned char)( ( 0x80 & _mcode ) >> 7 ) ); 
00144 };


Friends And Related Function Documentation

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

Definition at line 21 of file DCFmpacketBase.cpp.

00022 {
00023    bytepack bp;
00024    if ( !mp.empty() && os.good() ) {
00025       os << bp( mp._sizeb, mp._bplen_sizeb );
00026       os << bp( mp._mcode, 1 );
00027       os << bp( mp._n, mp._bplen_n );
00028 
00029       if ( mp._sizeb ) { 
00030           for( int i = 0; i < mp._sizeb; i++ ) { 
00031              os.put( mp._ptmpacket[i] ); 
00032           }
00033       }
00034 
00035       os << bp(mp._sizeb,mp._bplen_sizeb);
00036    }
00037    return os;
00038 };

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

Definition at line 40 of file DCFmpacketBase.cpp.

00041 {
00042    int itmp;
00043    bytepack bp;
00044    mp.clear();
00045    if ( is.good() ) {
00046       is >> bp( 0, mp._bplen_sizeb ); mp._sizeb = bp;
00047       if ( !mp.empty() ) {
00048          is >> bp(0,1); mp._mcode = char(bp);
00049          is >> bp(0,mp._bplen_n); mp._n = int(bp);
00050          if (mp._sizeb) for( int i = 0; i < mp._sizeb; i++ ) { 
00051             is.get( mp._ptmpacket[i] ); 
00052          }
00053          is >> bp( 0, mp._bplen_sizeb ); itmp = int(bp);
00054          if ( itmp != mp._sizeb ) {
00055            cout << mp._bplen_sizeb << " ERROR !=sizeb\n";
00056          }
00057       }
00058    }
00059    return is;
00060 };


Field Documentation

int DCFmpacketBase._bplen_n [protected]
 

Definition at line 57 of file DCFmpacketBase.h.

Referenced by bplen_n(), operator<<(), and operator>>().

int DCFmpacketBase._bplen_sizeb [protected]
 

Definition at line 56 of file DCFmpacketBase.h.

Referenced by bplen_sizeb(), operator<<(), and operator>>().

char DCFmpacketBase._mcode [protected]
 

Definition at line 53 of file DCFmpacketBase.h.

Referenced by m(), mcode(), operator<<(), operator>>(), order(), rs(), set(), and sw().

int DCFmpacketBase._n [protected]
 

Definition at line 54 of file DCFmpacketBase.h.

Referenced by n(), operator<<(), operator>>(), and set().

char* DCFmpacketBase._ptmpacket [protected]
 

Definition at line 59 of file DCFmpacketBase.h.

Referenced by DCFmpacketBase(), mpacket(), operator<<(), operator>>(), put(), setencode(), and ~DCFmpacketBase().

int DCFmpacketBase._sizeb [protected]
 

Definition at line 52 of file DCFmpacketBase.h.

Referenced by empty(), operator<<(), operator>>(), put(), reset(), and sizeb().

int DCFmpacketBase._sizebmax [protected]
 

Definition at line 51 of file DCFmpacketBase.h.

Referenced by DCFmpacketBase().


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