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

DCFsbostreamBase.h

Go to the documentation of this file.
00001 // DCFsbostreamBase.h
00002 //////////////////////////////////////////////////////////////////////
00003 //          (c) Copyright 2001-2002 Brown Deer Technology, LLC.
00004 //                        All rights reserved.
00005 //////////////////////////////////////////////////////////////////////
00006 
00007 #ifndef DCFSBOSTREAMBASE_H
00008 #define DCFSBOSTREAMBASE_H
00009 
00010 #ifdef USE_STD
00011 #include <iostream>
00012 #include <string>
00013 using namespace std;
00014 #else
00015 #include <iostream.h>
00016 #include <string.h>
00017 #endif
00018 
00019 #include "MCF_Code.h"
00020 
00021 class DCFsbostreamBase 
00022 {
00023    public:
00024 
00025       DCFsbostreamBase( const string& descript = "_", ostream& os = cout );
00026 
00027       ~DCFsbostreamBase();
00028 
00029       void set_author( const int author);
00030 
00031       void set_descript( const string& );
00032 
00033       void set_sbn( const int sbn );
00034 
00035       void set_mpart( 
00036         const int mmin_this, const int mmax_this,
00037         const int mmin_exist, const int mmax_exist,
00038         const int mmin_theory, const int mmax_theory
00039       );
00040 
00041       void set_cpart( 
00042         const int cmin_this, const int cmax_this,
00043         const int cmin_exist, const int cmax_exist,
00044         const int cmin_theory, const int cmax_theory
00045       );
00046 
00047       void set_bplen(
00048         const int bplen_mpsizeb, const int bplen_coef,
00049         const int bplen_n, const int bplen_a
00050       );
00051 
00052       void finalstep( const int );
00053       int finalstep();
00054 
00055       virtual void report( ostream& = cout );
00056 
00057       virtual bool isopen();
00058       virtual void outheader();
00059       virtual void close();
00060 
00061       virtual void open() {}
00062 
00063    protected:
00064       int _version;
00065       int _revision;
00066       int _release;
00067       int _author;
00068       string _descript;
00069 
00070       int _arraydim;
00071       int _sbn;
00072 
00073       int _mmin_this, _mmax_this;
00074       int _mmin_exist, _mmax_exist;
00075       int _mmin_theory, _mmax_theory;
00076 
00077       int _cmin_this, _cmax_this;
00078       int _cmin_exist, _cmax_exist;
00079       int _cmin_theory, _cmax_theory;
00080 
00081       int _bplen_mpsizeb;
00082       int _bplen_coef;
00083       int _datatype_code;
00084       int _bplen_n;
00085       int _bplen_a;
00086 
00087       ostream* _os;
00088 
00089       bool _needheader;
00090 
00091       bool _lockfinalstep;
00092       int _finalstep;
00093 };
00094 
00095 inline
00096 DCFsbostreamBase::DCFsbostreamBase( const string& descript, ostream& os) 
00097   : _version(0), _revision(2), _release(0), _author(0), _descript(descript),
00098     _arraydim(0), _sbn(0),
00099     _mmin_this(0), _mmax_this(31), _mmin_exist(0), _mmax_exist(31),
00100     _mmin_theory(0), _mmax_theory(31), 
00101     _cmin_this(0), _cmax_this(255), _cmin_exist(0), _cmax_exist(255),
00102     _cmin_theory(0), _cmax_theory(255), 
00103     _bplen_mpsizeb(2), _bplen_coef(8), 
00104     _datatype_code(MCF_CODE_UNKNOWN),
00105     _bplen_n(2), _bplen_a(2),
00106     _os(&os),
00107     _needheader(true), _lockfinalstep(false), _finalstep(-1)
00108 {}
00109 
00110 inline
00111 DCFsbostreamBase::~DCFsbostreamBase() 
00112 { 
00113    if ( _os != 0 ) { delete _os; _os = 0; } 
00114 }
00115 
00116 inline
00117 void DCFsbostreamBase::set_author( const int author) { _author = author; }
00118 
00119 inline
00120 void DCFsbostreamBase::set_descript( const string& descript  ) 
00121 {
00122    _descript = descript;
00123 };
00124 
00125 inline
00126 void DCFsbostreamBase::set_sbn( const int sbn ) { _sbn = sbn; }
00127 
00128 inline
00129 void DCFsbostreamBase::set_mpart( 
00130   const int mmin_this, const int mmax_this,
00131   const int mmin_exist, const int mmax_exist,
00132   const int mmin_theory, const int mmax_theory
00133 )
00134 {
00135   _mmin_this = mmin_this;
00136   _mmax_this = mmax_this;
00137   _mmin_exist = mmin_exist;
00138   _mmax_exist = mmax_exist;
00139   _mmin_theory = mmin_theory;
00140   _mmax_theory = mmax_theory;
00141 }
00142 
00143 inline
00144 void DCFsbostreamBase::set_cpart( 
00145   const int cmin_this, const int cmax_this,
00146   const int cmin_exist, const int cmax_exist,
00147   const int cmin_theory, const int cmax_theory
00148 )
00149 {
00150   _cmin_this = cmin_this;
00151   _cmax_this = cmax_this;
00152   _cmin_exist = cmin_exist;
00153   _cmax_exist = cmax_exist;
00154   _cmin_theory = cmin_theory;
00155   _cmax_theory = cmax_theory;
00156 }
00157 
00158 inline
00159 void DCFsbostreamBase::set_bplen(
00160   const int bplen_mpsizeb, const int bplen_coef,
00161   const int bplen_n, const int bplen_a
00162 )
00163 {
00164   _bplen_mpsizeb = bplen_mpsizeb;
00165   _bplen_coef = bplen_coef;
00166   _bplen_n = bplen_n;
00167   _bplen_a = bplen_a;
00168 }
00169 
00170 inline
00171 void DCFsbostreamBase::finalstep( const int finalstep ) 
00172 { 
00173    _finalstep = finalstep; 
00174 };
00175 
00176 inline
00177 int DCFsbostreamBase::finalstep() { return _finalstep; };
00178 
00179 inline
00180 bool DCFsbostreamBase::isopen() { return (*_os).good(); }
00181 
00182 #endif
00183 

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