Ignore:
Timestamp:
Dec 20, 2005, 7:25:51 PM (20 years ago)
Author:
ansari
Message:

Ajout constructeur de copie (pas parfait) pour FitsInOutFile + modifs classes FitsFile/FitsInFile/FitsOutFile pour heriter de FitsInOutFile avec constructeur a partir de FitsInOutFile - Reza 20/12/2005

File:
1 edited

Legend:

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

    r2844 r2860  
    111111  //  cout << " DBG - FitsInOutFile(string name= " << name << ")" << endl;
    112112  fptr_ = NULL;
     113  ownfptr = true;
    113114  SetDef_BinTable();
    114115  SetDef_StrColWidth();
     
    122123  //  cout << " DBG - FitsInOutFile(char* name= " << name << ")" << endl;
    123124  fptr_ = NULL;
     125  ownfptr = true;
    124126  SetDef_BinTable();
    125127  SetDef_StrColWidth();
    126128  Open(name, mode);
     129}
     130
     131/*! \brief Copy constructor
     132  The fits file pointer is owned by the original object and should not be closed
     133  as long as the new object is being used.
     134*/
     135FitsInOutFile::FitsInOutFile(FitsInOutFile const& fios)
     136{
     137  fptr_ = fios.fptr_;
     138  fname_ = fios.fname_;
     139  mode_ = fios.mode_;
     140  ownfptr = false;
     141  SetDef_BinTable();
     142  SetDef_StrColWidth();
    127143}
    128144
     
    177193  fname_ = name;
    178194  mode_ = mode;
     195  ownfptr = true;
    179196  return;
    180197}
     
    184201void FitsInOutFile::Close()
    185202{
     203  if (ownfptr == false) return;
    186204  if (fptr_ == NULL) return;
    187205  int status = 0;
Note: See TracChangeset for help on using the changeset viewer.