source: Sophya/trunk/SophyaExt/FitsIOServer/fitstarray.h@ 4017

Last change on this file since 4017 was 3572, checked in by cmv, 17 years ago

char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009

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
12namespace SOPHYA {
13
14
15/////////////////////////////////////////////////////////////////////////
16// Classe pour la gestion de persistance sur fichiers fits
17/////////////////////////////////////////////////////////////////////////
18
19
20
21template <class T>
22class FITS_TArray : public FitsIOHandler {
23
24public:
25
26FITS_TArray();
27FITS_TArray(const char inputfile[],int hdunum=0);
28FITS_TArray(const TArray<T> & obj);
29FITS_TArray(TArray<T> *obj);
30virtual ~FITS_TArray();
31virtual AnyDataObj* DataObj();
32virtual void SetDataObj(AnyDataObj & o);
33inline operator TArray<T>() { return(*dobj_); }
34
35protected :
36
37void ReadFromFits(FitsInFile& is);
38void WriteToFits(FitsOutFile& os) ;
39
40 TArray<T> * dobj_;
41 bool ownobj_;
42};
43//////////////////////////////////////////////////////////////////
44
45template <class T>
46inline FitsOutFile& operator << (FitsOutFile& fios, TArray<T> & arr)
47 { FITS_TArray<T> fih(&arr); fih.Write(fios); return (fios); }
48
49template <class T>
50inline 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.