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

DCFsbistreamBase.cpp

Go to the documentation of this file.
00001 // DCFsbistreamBase.cpp
00002 //////////////////////////////////////////////////////////////////////
00003 //          (c) Copyright 2001-2002 Brown Deer Technology, LLC.
00004 //                        All rights reserved.
00005 //////////////////////////////////////////////////////////////////////
00006 
00007 #ifdef USE_STD
00008 #include <string>
00009 using namespace std;
00010 #else
00011 #include <string.h>
00012 #endif
00013 
00014 #include "MCF_Code.h"
00015 
00016 #include "DCFsbistreamBase.h"
00017 
00018 DCFsbistreamBase::DCFsbistreamBase( istream& is ) 
00019   : _version(0), _revision(2), _release(0), _author(0), _descript(""),
00020     _arraydim(0), _sbn(0),
00021     _mmin_this(0), _mmax_this(31), _mmin_exist(0), _mmax_exist(31),
00022     _mmin_theory(0), _mmax_theory(31), 
00023     _cmin_this(0), _cmax_this(255), _cmin_exist(0), _cmax_exist(255),
00024     _cmin_theory(0), _cmax_theory(255), 
00025     _bplen_mpsizeb(2), _bplen_coef(8), 
00026     _datatype_code(MCF_CODE_UNKNOWN),
00027     _bplen_n(2), _bplen_a(2),
00028     _is(&is)
00029 {
00030 #ifdef STORM_DEBUG
00031    cout << "DCFsbistreamBase Constructor.\n";
00032 #endif
00033 //   _finalstep =( 1 << _mmax ) - 1;    HACK
00034    _finalstep = -1;
00035 }
00036 
00037 void DCFsbistreamBase::report( ostream& os ) 
00038 {
00039    os << "DCFsbistreamBase::report():\n";
00040    os << "   DCF REPORT version= " <<_version << endl;
00041    os << "   DCF REPORT revision= " << _revision << endl;
00042    os << "   DCF REPORT release= " << _release << endl;
00043    os << "   DCF REPORT author= " << _author << endl;
00044    os << "   DCF REPORT descript.size()= " << _descript.size() << endl;
00045    os << "   DCF REPORT descript= " << _descript << endl;
00046 
00047    os << "   DCF REPORT arraydim= " << _arraydim << endl;
00048    os << "   DCF REPORT bplen_mpsizeb= " << _bplen_mpsizeb << endl;
00049    os << "   DCF REPORT bplen_coef= " << _bplen_coef << endl;
00050    os << "   DCF REPORT bplen_n= " << _bplen_n << endl;
00051    for( int d = 0; d < _arraydim; ++d ) {
00052       os << "   DCF REPORT bplen_a[" << d << "]= " << _bplen_a << endl;
00053    }
00054 
00055    os << "   DCF REPORT sbn= " << _sbn << endl;
00056    os << "   DCF REPORT mmin_this= " << _mmin_this << endl;
00057    os << "   DCF REPORT mmax_this= " << _mmax_this << endl;
00058    os << "   DCF REPORT mmin_exist= " << _mmin_exist << endl;
00059    os << "   DCF REPORT mmax_exist= " << _mmax_exist << endl;
00060    os << "   DCF REPORT mmin_theory= " << _mmin_theory << endl;
00061    os << "   DCF REPORT mmax_theory= " << _mmax_theory << endl;
00062    os << "   DCF REPORT cmin_this= " << _cmin_this << endl;
00063    os << "   DCF REPORT cmax_this= " << _cmax_this << endl;
00064    os << "   DCF REPORT cmin_exist= " << _cmin_exist << endl;
00065    os << "   DCF REPORT cmax_exist= " << _cmax_exist << endl;
00066    os << "   DCF REPORT cmin_theory= " << _cmin_theory << endl;
00067    os << "   DCF REPORT cmax_theory= " << _cmax_theory << endl;
00068    os << "   DCF REPORT datatype_code= " << _datatype_code << endl;
00069 
00070    os << "   DCF REPORT finalstep=" << _finalstep << '\n';
00071 };
00072 
00073 void DCFsbistreamBase::inheader() 
00074 {
00075    char c;
00076    bytepack bp;
00077 
00078    char ptc[9];
00079    for( int i = 0; i < 8; i++ ) { 
00080       (*_is) >> ptc[i]; 
00081 #ifdef STORM_DEBUG
00082       cout << ptc[i];  
00083 #endif
00084    }
00085    ptc[8] = 0;
00086    if ( strcmp(ptc,"MCFsb___\0") ) { 
00087      cout << "not a DCFsb file!\n"; 
00088    }
00089 
00090    (*_is) >> bp( 0, 4 ); int mcfsizeb1 = int(bp);
00091 
00092    (*_is) >> bp( 0, 1 ); _version = int(bp);
00093    (*_is) >> bp( 0, 1 ); _revision = int(bp);
00094    (*_is) >> bp( 0, 1 ); _release = int(bp);
00095    (*_is) >> bp( 0, 1 ); _author = int(bp);
00096    
00097    (*_is) >> bp( 0, 1 ); int ii = int(bp);
00098    _descript="";
00099    for( int i = 0; i < ii; i++ ) { 
00100       (*_is).get(c); 
00101       _descript += c; 
00102    }
00103 
00104 //   (*_is) >> bp( 0, 4 ); int mpsizeb1 = int(bp);
00105    (*_is) >> bp( 0, 4 ); int sbsizeb1 = int(bp);
00106 
00107    (*_is) >> bp( 0, 1 );
00108    (*_is) >> bp( 0, 1 ); _arraydim = int(bp);
00109    (*_is) >> bp( 0, 1 ); _bplen_mpsizeb = int(bp);
00110    (*_is) >> bp( 0, 1 ); _bplen_coef = int(bp);
00111    (*_is) >> bp( 0, 1 ); _bplen_n = int(bp);
00112    for( int d = 0; d < _arraydim; ++d ) {
00113       (*_is) >> bp( 0, 1 ); _bplen_a = int(bp);
00114    }
00115 
00116    (*_is) >> bp( 0, 4 ); _sbn = int(bp);
00117    (*_is) >> bp( 0, 1 ); _mmin_this = int(bp);
00118    (*_is) >> bp( 0, 1 ); _mmax_this = int(bp);
00119    (*_is) >> bp( 0, 1 ); _mmin_exist = int(bp);
00120    (*_is) >> bp( 0, 1 ); _mmax_exist = int(bp);
00121    (*_is) >> bp( 0, 1 ); _mmin_theory = int(bp);
00122    (*_is) >> bp( 0, 1 ); _mmax_theory = int(bp);
00123    (*_is) >> bp( 0, 1 ); _cmin_this = int(bp);
00124    (*_is) >> bp( 0, 1 ); _cmax_this = int(bp);
00125    (*_is) >> bp( 0, 1 ); _cmin_exist = int(bp);
00126    (*_is) >> bp( 0, 1 ); _cmax_exist = int(bp);
00127    (*_is) >> bp( 0, 1 ); _cmin_theory = int(bp);
00128    (*_is) >> bp( 0, 1 ); _cmax_theory = int(bp);
00129    (*_is) >> bp( 0, 1 ); int datatype_code = int(bp);
00130    (*_is) >> bp( 0, 1 );
00131    (*_is) >> bp( 0, 1 );
00132    (*_is) >> bp( 0, 1 );
00133 
00134 //   _finalstep = ( 1 << _mmax ) - 1;   HACK
00135    _finalstep = -1;
00136 
00137    if (datatype_code != _datatype_code )
00138      cout << "DCFsbistreamBase::inheader(): WARNING: datatype_code mismatch\n";
00139 
00140 };
00141 

Generated on Mon May 31 21:38:44 2004 for SR2k4 Assembler by doxygen 1.3.6