Ignore:
Timestamp:
Sep 8, 2006, 4:30:31 PM (19 years ago)
Author:
ansari
Message:

Correction plusieurs bugs lies a SwFitsDataTable - Reza 08/09/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/swfitsdtable.cc

    r3032 r3069  
    7070  mFgCreate = false;
    7171}
    72 /*! Constructor with the specification of the output swap stream -
    73     and optional specification of block (or segment) size
     72/*!
     73  \brief Construcor with specification of the \b FitsInOutFile swap stream.
     74  if fgcreate == true, creates an empty table (the fits file should then be
     75  opened for writing).
     76  if fgcreate == false , the table is initialized (read in) from the current HDU.
    7477*/
    7578SwFitsDataTable::SwFitsDataTable(FitsInOutFile & os, sa_size_t segsz, bool fgcreate)
     
    8285  }
    8386}
     87
     88/*!
     89  \brief Construcor with specification of the FITS file name.
     90  if fgcreate == false , the FITS file is opened and the table is
     91  initialized (read in) from HDU \b hdunum
     92*/
     93SwFitsDataTable::SwFitsDataTable(string fitsname, int hdunum, sa_size_t segsz)
     94  : BaseDataTable(segsz) ,
     95    mSwF(fitsname, FitsInOutFile::Fits_RO)
     96{
     97  // Lecture de la table
     98  FitsHandler<BaseDataTable> fio(*this);
     99  mSwF.MoveAbsToHDU(hdunum);
     100  fio.Read(mSwF);
     101}
     102
    84103//! copy constructor - shares the data
    85104SwFitsDataTable::SwFitsDataTable(SwFitsDataTable const & a)
     
    158177void SwFitsDataTable::SwapOutAll() const
    159178{
     179  if (NRows() < 1) return;
    160180  // Et on vide les buffers de swap
    161181  for (size_t kk=0; kk<mNames.size(); kk++) {
     
    185205      break;
    186206    default:
    187       throw ForbiddenError("SwFitsDataTable::Share() : unknown column type ");
     207      throw ForbiddenError("SwFitsDataTable::SwapOutAll() : unknown column type ");
    188208    break;
    189209    }
     
    261281  {
    262282    ser = mICols.size();
    263     FITSDataSwapper<int_4> ISwapper(mSwF, colidx);
     283    FITSDataSwapper<int_4> ISwapper(mSwF, colidx, this);
    264284    if (swpos)
    265285      mICols.push_back(SwSegDataBlock<int_4>(ISwapper, *swpos, mSegSz));
     
    275295  {
    276296    ser = mLCols.size();
    277     FITSDataSwapper<int_8> LSwapper(mSwF, colidx);
     297    FITSDataSwapper<int_8> LSwapper(mSwF, colidx, this);
    278298    if (swpos)   
    279299      mLCols.push_back(SwSegDataBlock<int_8>(LSwapper, *swpos, mSegSz));
     
    289309  {
    290310    ser = mFCols.size();
    291     FITSDataSwapper<r_4> FSwapper(mSwF, colidx);
     311    FITSDataSwapper<r_4> FSwapper(mSwF, colidx, this);
    292312    if (swpos)   
    293313      mFCols.push_back(SwSegDataBlock<r_4>(FSwapper, *swpos, mSegSz));
     
    304324  {
    305325    ser = mDCols.size();
    306     FITSDataSwapper<r_8> DSwapper(mSwF, colidx);
     326    FITSDataSwapper<r_8> DSwapper(mSwF, colidx, this);
    307327    if (swpos)   
    308328      mDCols.push_back(SwSegDataBlock<r_8>(DSwapper, *swpos, mSegSz));
     
    318338  {
    319339    ser = mYCols.size();
    320     FITSDataSwapper< complex<r_4> > YSwapper(mSwF, colidx);
     340    FITSDataSwapper< complex<r_4> > YSwapper(mSwF, colidx, this);
    321341    if (swpos)   
    322342      mYCols.push_back(SwSegDataBlock< complex<r_4> >(YSwapper, *swpos, mSegSz));
     
    332352  {
    333353    ser = mZCols.size();
    334     FITSDataSwapper< complex<r_8> > ZSwapper(mSwF, colidx);
     354    FITSDataSwapper< complex<r_8> > ZSwapper(mSwF, colidx, this);
    335355    if (swpos)   
    336356      mZCols.push_back(SwSegDataBlock< complex<r_8> >(ZSwapper, *swpos, mSegSz));
     
    346366  {
    347367    ser = mSCols.size();
    348     FITSDataSwapper< string > SSwapper(mSwF, colidx);
     368    FITSDataSwapper< string > SSwapper(mSwF, colidx, this);
    349369    if (swpos)   
    350370      mSCols.push_back(SwSegDataBlock< string >(SSwapper, *swpos, mSegSz));
Note: See TracChangeset for help on using the changeset viewer.