#include <DCFsbifstream.h>
Inheritance diagram for DCFsbifstream< Data_t >:


Public Member Functions | |
| void | close () |
| void | close () |
| DCFsbifstream (const string &="_\0") | |
| DCFsbifstream (const string &="_\0") | |
| void | filenamebase (const string &) |
| void | filenamebase (const string &) |
| void | findmpacket (DCFmpBase &, const char mcode, const int n) |
| void | findmpacket (DCFmpacketBase &, const char, const int) |
| void | initmfilepos () |
| void | initmfilepos () |
| bool | isopen () |
| bool | isopen () |
| void | open () |
| void | open () |
| ~DCFsbifstream () | |
| ~DCFsbifstream () | |
Private Attributes | |
| string | _filenamebase |
| string | _filenamesb |
| ifstream * | _ifs |
| int | _lenfilenamebase |
| int * | _mfilepos |
| int * | _mfilepos |
|
||||||||||
|
Definition at line 43 of file DCFsbifstream.h. References DCFsbifstream< Data_t >._filenamebase, DCFsbifstream< Data_t >._lenfilenamebase, and DCFsbifstream< Data_t >._mfilepos.
00044 : DCFsbistream<Data_t>( *( _ifs = new ifstream ) ) 00045 { 00046 _lenfilenamebase = filenamebase.size(); 00047 _filenamebase = filenamebase; 00048 _mfilepos = new int[256]; 00049 }; |
|
|||||||||
|
Definition at line 52 of file DCFsbifstream.h. References DCFsbifstream< Data_t >._mfilepos.
|
|
||||||||||
|
|
|
|||||||||
|
|
|
|||||||||
|
Reimplemented from DCFsbistreamBase. |
|
|||||||||
|
Reimplemented from DCFsbistreamBase. Definition at line 83 of file DCFsbifstream.h. Referenced by DCFsbifstream< Data_t >.open().
00083 { (*_ifs).close(); }
|
|
||||||||||
|
|
|
||||||||||
|
Definition at line 60 of file DCFsbifstream.h. References DCFsbifstream< Data_t >._filenamebase, and DCFsbifstream< Data_t >._lenfilenamebase.
00061 {
00062 _lenfilenamebase = filenamebase.size();
00063 _filenamebase = filenamebase;
00064 };
|
|
||||||||||||||||||||
|
Reimplemented from DCFsbistreamBase. Definition at line 96 of file 2/DCFsbifstream.h. References DCFsbifstream< Data_t >._mfilepos, DCFmpBase.clear(), and DCFmpBase.empty().
00099 {
00100 bool found = false;
00101 bool missing = false;
00102 bool eof = false;
00103 int nextfilepos;
00104 bytepack bp;
00105
00106 #ifdef STORM_DEBUG
00107 cout << "DCFsbifstream.findmpacket(): SEARCHING FOR : mcode "
00108 << int( (unsigned char)(mcode) ) << '\n';
00109 #endif
00110
00111 mp.clear();
00112 (*_is).seekg( _mfilepos[ int( (unsigned char)(mcode) ) ], ios::beg );
00113 int i0 = (*_is).tellg();
00114
00115 while ( (*_is).good() & !found & !missing & !eof ) {
00116 nextfilepos = (*_is).tellg();
00117 (*_is) >> mp;
00118 #ifdef STORM_DEBUG
00119 cout << "DCFsbifstream.findmpacket(): mp.mcode() mp.empty() "
00120 << int( (unsigned char)(mp.mcode()) ) << ' ' << mp.empty() << '\n';
00121 #endif
00122 // if ( mp.empty() ) {
00123 if ( mp.null() ) {
00124 (*_is) >> bp( 0, 4 );
00125 (*_is) >> bp( 0, 4 );
00126 (*_is) >> bp( 0, _bplen_n ); _finalstep = bp;
00127 #ifdef STORM_DEBUG
00128 cout << "FINALSTEP " << _finalstep << '\n';
00129 #endif
00130 eof = true;
00131 }
00132 else {
00133 if ( ( mp.mcode() == mcode ) && ( mp.n() == n ) ) {
00134 found=true;
00135 }
00136 if ( ( mp.mcode() == mcode ) && ( mp.n() > n ) ) {
00137 missing=true;
00138 // mp.reset(); HACK ?
00139 mp.clear();
00140 }
00141 }
00142 }
00143
00144 int i1=(*_is).tellg();
00145 if (found) {
00146 _mfilepos[ int( (unsigned char)(mcode) ) ] = (*_is).tellg();
00147 }
00148 else {
00149 _mfilepos[ int( (unsigned char)(mcode) ) ] = nextfilepos;
00150 }
00151
00152 #ifdef STORM_DEBUG
00153 cout << "DCFsbifstream.findmpacket(): mcode _result_ _mfilepos[mcode] "
00154 << int( (unsigned char)(mcode) );
00155 if (found) cout << " FOUND ";
00156 if (missing) cout << " MISSING ";
00157 if (eof) cout << " EOF ";
00158 cout << _mfilepos[ int( (unsigned char)(mcode) ) ] << ' ' << n << '\n';
00159 #endif
00160 };
|
|
||||||||||||||||||||
|
Reimplemented from DCFsbistreamBase. Definition at line 95 of file DCFsbifstream.h. References DCFsbifstream< Data_t >._mfilepos, DCFmpacketBase.clear(), and DCFmpacketBase.empty().
00100 {
00101 bool found = false;
00102 bool missing = false;
00103 bool eof = false;
00104 int nextfilepos;
00105 bytepack bp;
00106
00107 #ifdef STORM_DEBUG
00108 cout << "DCFsbifstream.findmpacket(): SEARCHING FOR : mcode "
00109 << int( (unsigned char)(mcode) ) << '\n';
00110 #endif
00111
00112 mp.clear();
00113 (*_is).seekg( _mfilepos[ int( (unsigned char)(mcode) ) ], ios::beg );
00114 int i0 = (*_is).tellg();
00115
00116 while ( (*_is).good() & !found & !missing & !eof ) {
00117 nextfilepos = (*_is).tellg();
00118 (*_is) >> mp;
00119 #ifdef STORM_DEBUG
00120 cout << "DCFsbifstream.findmpacket(): mp.mcode() mp.empty() "
00121 << int( (unsigned char)(mp.mcode()) ) << ' ' << mp.empty() << '\n';
00122 #endif
00123 if ( mp.empty() ) {
00124 (*_is) >> bp( 0, _bplen_n ); _finalstep = bp;
00125 // cout << "FINALSTEP " << _finalstep << '\n';
00126 eof = true;
00127 }
00128 if ( ( mp.mcode() == mcode ) && ( mp.n() == n ) ) {
00129 found=true;
00130 }
00131 if ( ( mp.mcode() == mcode ) && ( mp.n() > n ) ) {
00132 missing=true;
00133 mp.reset();
00134 }
00135 }
00136
00137 int i1=(*_is).tellg();
00138 if (found) {
00139 _mfilepos[ int( (unsigned char)(mcode) ) ] = (*_is).tellg();
00140 }
00141 else {
00142 _mfilepos[ int( (unsigned char)(mcode) ) ] = nextfilepos;
00143 }
00144
00145 #ifdef STORM_DEBUG
00146 cout << "DCFsbifstream.findmpacket(): mcode _result_ _mfilepos[mcode] "
00147 << int( (unsigned char)(mcode) );
00148 if (found) cout << " FOUND ";
00149 if (missing) cout << " MISSING ";
00150 if (eof) cout << " EOF ";
00151 cout << _mfilepos[ int( (unsigned char)(mcode) ) ] << ' ' << n << '\n';
00152 #endif
00153 };
|
|
|||||||||
|
|
|
|||||||||
|
Definition at line 86 of file DCFsbifstream.h. References DCFsbifstream< Data_t >._mfilepos. Referenced by DCFsbifstream< Data_t >.open().
|
|
|||||||||
|
Reimplemented from DCFsbistreamBase. |
|
|||||||||
|
Reimplemented from DCFsbistreamBase. Definition at line 67 of file DCFsbifstream.h. Referenced by DCFsbifstream< Data_t >.open().
00067 { return (*_ifs).is_open(); }
|
|
|||||||||
|
Reimplemented from DCFsbistream< Data_t >. |
|
|||||||||
|
Reimplemented from DCFsbistream< Data_t >. Definition at line 70 of file DCFsbifstream.h. References DCFsbifstream< Data_t >._filenamebase, DCFsbifstream< Data_t >._filenamesb, DCFsbifstream< Data_t >.close(), dcfsbfilename(), DCFsbistream< Data_t >.descr(), DCFsbifstream< Data_t >.initmfilepos(), DCFsbifstream< Data_t >.isopen(), and DCFsbistream< Data_t >.open().
00071 {
00072 if (isopen()) close();
00073 dcfsbfilename( _blocknum, _filenamebase, _filenamesb );
00074 (*_ifs).open( _filenamesb.c_str() );
00075 DCFsbistream<Data_t>::open();
00076 initmfilepos();
00077 //#ifdef STORM_DEBUG
00078 descr();
00079 //#endif
00080 };
|
|
|||||
|
Definition at line 35 of file 2/DCFsbifstream.h. Referenced by DCFsbifstream< Data_t >.DCFsbifstream(), DCFsbifstream< Data_t >.filenamebase(), and DCFsbifstream< Data_t >.open(). |
|
|||||
|
Definition at line 36 of file 2/DCFsbifstream.h. Referenced by DCFsbifstream< Data_t >.open(). |
|
|||||
|
Definition at line 38 of file DCFsbifstream.h. |
|
|||||
|
Definition at line 35 of file DCFsbifstream.h. Referenced by DCFsbifstream< Data_t >.DCFsbifstream(), and DCFsbifstream< Data_t >.filenamebase(). |
|
|||||
|
Definition at line 37 of file 2/DCFsbifstream.h. |
|
|||||
|
Definition at line 39 of file DCFsbifstream.h. Referenced by DCFsbifstream< Data_t >.DCFsbifstream(), DCFsbifstream< Data_t >.findmpacket(), DCFsbifstream< Data_t >.initmfilepos(), and DCFsbifstream< Data_t >.~DCFsbifstream(). |
1.3.6