Last change
on this file since 3047 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
|
Rev | Line | |
---|
[863] | 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>
|
---|
[1136] | 22 | class FITS_TArray : public FitsIOHandler {
|
---|
[863] | 23 |
|
---|
| 24 | public:
|
---|
| 25 |
|
---|
| 26 | FITS_TArray();
|
---|
[1174] | 27 | FITS_TArray(char inputfile[],int hdunum=0);
|
---|
[863] | 28 | FITS_TArray(const TArray<T> & obj);
|
---|
| 29 | FITS_TArray(TArray<T> *obj);
|
---|
| 30 | virtual ~FITS_TArray();
|
---|
| 31 | virtual AnyDataObj* DataObj();
|
---|
[1136] | 32 | virtual void SetDataObj(AnyDataObj & o);
|
---|
[863] | 33 | inline operator TArray<T>() { return(*dobj_); }
|
---|
| 34 |
|
---|
| 35 | protected :
|
---|
| 36 |
|
---|
[1136] | 37 | void ReadFromFits(FitsInFile& is);
|
---|
| 38 | void WriteToFits(FitsOutFile& os) ;
|
---|
[863] | 39 |
|
---|
| 40 | TArray<T> * dobj_;
|
---|
[1136] | 41 | bool ownobj_;
|
---|
[863] | 42 | };
|
---|
| 43 | //////////////////////////////////////////////////////////////////
|
---|
| 44 |
|
---|
[1231] | 45 | template <class T>
|
---|
| 46 | inline FitsOutFile& operator << (FitsOutFile& fios, TArray<T> & arr)
|
---|
| 47 | { FITS_TArray<T> fih(&arr); fih.Write(fios); return (fios); }
|
---|
[863] | 48 |
|
---|
[1231] | 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 |
|
---|
[863] | 53 | } // Fin du namespace
|
---|
| 54 |
|
---|
| 55 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.