Last change
on this file since 1814 was 1231, checked in by ansari, 25 years ago |
Modifs cosmetiques + introduction des operateurs << et >> sur
FitsOut/InFile - Reza 12/10/2000
|
File size:
1.2 KB
|
Line | |
---|
1 | // Guy Le Meur 04/2000
|
---|
2 |
|
---|
3 |
|
---|
4 | #ifndef FITSTARRAY_SEEN
|
---|
5 | #define FITSTARRAY_SEEN
|
---|
6 |
|
---|
7 |
|
---|
8 | #include "pexceptions.h"
|
---|
9 | #include "tarray.h"
|
---|
10 | #include "fitsfile.h"
|
---|
11 |
|
---|
12 | namespace SOPHYA {
|
---|
13 |
|
---|
14 |
|
---|
15 | /////////////////////////////////////////////////////////////////////////
|
---|
16 | // Classe pour la gestion de persistance sur fichiers fits
|
---|
17 | /////////////////////////////////////////////////////////////////////////
|
---|
18 |
|
---|
19 |
|
---|
20 |
|
---|
21 | template <class T>
|
---|
22 | class FITS_TArray : public FitsIOHandler {
|
---|
23 |
|
---|
24 | public:
|
---|
25 |
|
---|
26 | FITS_TArray();
|
---|
27 | FITS_TArray(char inputfile[],int hdunum=0);
|
---|
28 | FITS_TArray(const TArray<T> & obj);
|
---|
29 | FITS_TArray(TArray<T> *obj);
|
---|
30 | virtual ~FITS_TArray();
|
---|
31 | virtual AnyDataObj* DataObj();
|
---|
32 | virtual void SetDataObj(AnyDataObj & o);
|
---|
33 | inline operator TArray<T>() { return(*dobj_); }
|
---|
34 |
|
---|
35 | protected :
|
---|
36 |
|
---|
37 | void ReadFromFits(FitsInFile& is);
|
---|
38 | void WriteToFits(FitsOutFile& os) ;
|
---|
39 |
|
---|
40 | TArray<T> * dobj_;
|
---|
41 | bool ownobj_;
|
---|
42 | };
|
---|
43 | //////////////////////////////////////////////////////////////////
|
---|
44 |
|
---|
45 | template <class T>
|
---|
46 | inline FitsOutFile& operator << (FitsOutFile& fios, TArray<T> & arr)
|
---|
47 | { FITS_TArray<T> fih(&arr); fih.Write(fios); return (fios); }
|
---|
48 |
|
---|
49 | template <class T>
|
---|
50 | inline FitsInFile& operator >> (FitsInFile& fiis, TArray<T> & arr)
|
---|
51 | { FITS_TArray<T> fih(&arr); fih.Read(fiis); return (fiis); }
|
---|
52 |
|
---|
53 | } // Fin du namespace
|
---|
54 |
|
---|
55 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.