| [1209] | 1 | // Guy Le Meur 06/2000 | 
|---|
|  | 2 |  | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #ifndef FITSBntblLineRW_SEEN | 
|---|
|  | 5 | #define FITSBntblLineRW_SEEN | 
|---|
| [1219] | 6 | #include "dvlist.h" | 
|---|
| [1209] | 7 | #include "fitsfile.h" | 
|---|
|  | 8 | //#include "xntuple.h" | 
|---|
|  | 9 |  | 
|---|
|  | 10 | namespace SOPHYA { | 
|---|
|  | 11 | /////////////////////////////////////////////////////////// | 
|---|
|  | 12 | //   Lecture ligne par ligne d'une BINTABLE sur fichier FITS | 
|---|
|  | 13 | // | 
|---|
|  | 14 | /////////////////////////////////////////////////////////// | 
|---|
|  | 15 |  | 
|---|
|  | 16 | class  FITS_BntblLineReader : public FitsIOHandler | 
|---|
|  | 17 | { | 
|---|
|  | 18 |  | 
|---|
|  | 19 | public: | 
|---|
|  | 20 | FITS_BntblLineReader(); | 
|---|
| [2197] | 21 | FITS_BntblLineReader(const char inputfile[],int hdunum=2); | 
|---|
| [1209] | 22 | ~FITS_BntblLineReader(); | 
|---|
|  | 23 |  | 
|---|
|  | 24 | BnTblLine& ReadNextLine(); | 
|---|
|  | 25 | inline  BnTblLine& GetBnTblLine()  {return ligne_;} | 
|---|
|  | 26 | inline long GetNextLineIndex() const {return nextLineToBeRead_;} | 
|---|
|  | 27 | inline  void SetStartingLineIndex(long n)  { nextLineToBeRead_ = n;} | 
|---|
|  | 28 |  | 
|---|
|  | 29 | inline int status() const {return inFits_->statusF();}; | 
|---|
|  | 30 | inline string GetStatus(int status) const {return inFits_->GetErrStatus(status);}; | 
|---|
|  | 31 |  | 
|---|
| [2201] | 32 | // Renvoie une reference sur l''objet DVList Associe | 
|---|
|  | 33 | inline const DVList& DVListFromFits() const | 
|---|
|  | 34 | { | 
|---|
|  | 35 | return(inFits_->DVListFromFits()); | 
|---|
|  | 36 | } | 
|---|
| [1209] | 37 |  | 
|---|
|  | 38 |  | 
|---|
|  | 39 | protected: | 
|---|
|  | 40 |  | 
|---|
|  | 41 | // implementation de  FitsIOHandler | 
|---|
|  | 42 | virtual void  ReadFromFits(FitsInFile& is) {}; | 
|---|
|  | 43 | virtual void    WriteToFits(FitsOutFile& os) {}; | 
|---|
|  | 44 |  | 
|---|
|  | 45 | private : | 
|---|
|  | 46 |  | 
|---|
|  | 47 | inline void InitNull() | 
|---|
|  | 48 | { | 
|---|
|  | 49 | inFits_ = NULL; | 
|---|
|  | 50 | nextLineToBeRead_= 0; | 
|---|
|  | 51 | } | 
|---|
|  | 52 | // attributs de classe | 
|---|
|  | 53 |  | 
|---|
|  | 54 | FitsInFile* inFits_; | 
|---|
| [1300] | 55 | long nextLineToBeRead_; | 
|---|
|  | 56 | BnTblLine ligne_; | 
|---|
| [1209] | 57 | }; | 
|---|
|  | 58 |  | 
|---|
|  | 59 |  | 
|---|
|  | 60 | ////////////////////////////////////////////////////////////////// | 
|---|
|  | 61 |  | 
|---|
|  | 62 |  | 
|---|
|  | 63 | class  FITS_BntblLineWriter : public FitsIOHandler | 
|---|
|  | 64 | { | 
|---|
|  | 65 |  | 
|---|
| [1219] | 66 |  | 
|---|
| [1209] | 67 | public: | 
|---|
| [1359] | 68 | FITS_BntblLineWriter(char inputfile[],int dc, int fc, int ic, int lc, int bc,int cc, vector<string> names, DVList* dvl=NULL, FitsFile::WriteMode wrm = FitsFile::clear); | 
|---|
| [1209] | 69 | ~FITS_BntblLineWriter(); | 
|---|
|  | 70 | void WriteNextLine( BnTblLine& WorkLine); | 
|---|
|  | 71 |  | 
|---|
| [2201] | 72 | // Renvoie une reference sur l''objet DVList Associe | 
|---|
|  | 73 | //inline const DVList& DVListFromFits() const | 
|---|
|  | 74 | //  { | 
|---|
|  | 75 | //   return(outFits_->DVListFromFits()); | 
|---|
|  | 76 | // } | 
|---|
| [1219] | 77 |  | 
|---|
| [1209] | 78 | private : | 
|---|
|  | 79 |  | 
|---|
|  | 80 | inline void InitNull() | 
|---|
|  | 81 | { | 
|---|
|  | 82 | outFits_ = NULL; | 
|---|
|  | 83 | nextLineToBeWritten_= 0; | 
|---|
|  | 84 | } | 
|---|
|  | 85 |  | 
|---|
|  | 86 | protected: | 
|---|
|  | 87 |  | 
|---|
|  | 88 | // implementation de  FitsIOHandler | 
|---|
|  | 89 | virtual void  ReadFromFits(FitsInFile& is) {}; | 
|---|
|  | 90 | virtual void    WriteToFits(FitsOutFile& os) {}; | 
|---|
|  | 91 |  | 
|---|
|  | 92 |  | 
|---|
|  | 93 | // attributs de classe | 
|---|
|  | 94 |  | 
|---|
|  | 95 | FitsOutFile* outFits_; | 
|---|
|  | 96 | long nextLineToBeWritten_; | 
|---|
|  | 97 | BnTblLine ligne_; | 
|---|
|  | 98 | }; | 
|---|
|  | 99 |  | 
|---|
|  | 100 |  | 
|---|
|  | 101 | } // Fin du namespace | 
|---|
|  | 102 |  | 
|---|
|  | 103 | #endif | 
|---|