1 | // Guy Le Meur 06/2000
|
---|
2 |
|
---|
3 |
|
---|
4 | #ifndef FITSBntblLineRW_SEEN
|
---|
5 | #define FITSBntblLineRW_SEEN
|
---|
6 | #include "dvlist.h"
|
---|
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();
|
---|
21 | FITS_BntblLineReader(char inputfile[],int hdunum=2);
|
---|
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 |
|
---|
32 |
|
---|
33 |
|
---|
34 | protected:
|
---|
35 |
|
---|
36 | // implementation de FitsIOHandler
|
---|
37 | virtual void ReadFromFits(FitsInFile& is) {};
|
---|
38 | virtual void WriteToFits(FitsOutFile& os) {};
|
---|
39 |
|
---|
40 | private :
|
---|
41 |
|
---|
42 | inline void InitNull()
|
---|
43 | {
|
---|
44 | inFits_ = NULL;
|
---|
45 | nextLineToBeRead_= 0;
|
---|
46 | }
|
---|
47 | // attributs de classe
|
---|
48 |
|
---|
49 | FitsInFile* inFits_;
|
---|
50 | long nextLineToBeRead_;
|
---|
51 | BnTblLine ligne_;
|
---|
52 | };
|
---|
53 |
|
---|
54 |
|
---|
55 | //////////////////////////////////////////////////////////////////
|
---|
56 |
|
---|
57 |
|
---|
58 | class FITS_BntblLineWriter : public FitsIOHandler
|
---|
59 | {
|
---|
60 |
|
---|
61 |
|
---|
62 | public:
|
---|
63 | FITS_BntblLineWriter(char inputfile[],int dc, int fc, int ic, int cc, vector<string> names, DVList& dvl, WriteMode wrm = clear);
|
---|
64 | ~FITS_BntblLineWriter();
|
---|
65 | void WriteNextLine( BnTblLine& WorkLine);
|
---|
66 |
|
---|
67 | // Renvoie une reference sur l''objet DVList Associe
|
---|
68 | DVList& Info()
|
---|
69 | {
|
---|
70 | if (dvl_ == NULL) dvl_ = new DVList;
|
---|
71 | return(*dvl_);
|
---|
72 | }
|
---|
73 |
|
---|
74 | private :
|
---|
75 |
|
---|
76 | inline void InitNull()
|
---|
77 | {
|
---|
78 | dvl_ = NULL;
|
---|
79 | outFits_ = NULL;
|
---|
80 | nextLineToBeWritten_= 0;
|
---|
81 | }
|
---|
82 |
|
---|
83 | protected:
|
---|
84 |
|
---|
85 | // implementation de FitsIOHandler
|
---|
86 | virtual void ReadFromFits(FitsInFile& is) {};
|
---|
87 | virtual void WriteToFits(FitsOutFile& os) {};
|
---|
88 |
|
---|
89 |
|
---|
90 | // attributs de classe
|
---|
91 |
|
---|
92 | FitsOutFile* outFits_;
|
---|
93 | long nextLineToBeWritten_;
|
---|
94 | BnTblLine ligne_;
|
---|
95 | DVList* dvl_;
|
---|
96 | };
|
---|
97 |
|
---|
98 |
|
---|
99 | } // Fin du namespace
|
---|
100 |
|
---|
101 | #endif
|
---|