| [2820] | 1 | #ifndef FITSMANAGER_H | 
|---|
|  | 2 | #define FITSMANAGER_H | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #include "machdefs.h" | 
|---|
|  | 5 | #include <string> | 
|---|
| [2898] | 6 | #include <iostream> | 
|---|
| [2820] | 7 | #include "fitsinoutfile.h" | 
|---|
|  | 8 |  | 
|---|
|  | 9 | namespace SOPHYA { | 
|---|
|  | 10 |  | 
|---|
|  | 11 | class FitsHandlerInterface; | 
|---|
|  | 12 |  | 
|---|
|  | 13 | /*! | 
|---|
|  | 14 | \ingroup FitsIOServer | 
|---|
|  | 15 | \brief Top level FITS I/O operations and handler management. | 
|---|
|  | 16 | */ | 
|---|
|  | 17 | class FitsManager { | 
|---|
|  | 18 | public: | 
|---|
| [2864] | 19 | //! Called once for each handler during init phase. | 
|---|
| [2895] | 20 | static int  RegisterHandler(FitsHandlerInterface * fhi, int glev=0, string desc=""); | 
|---|
| [2864] | 21 | //! Print list of handlers on cout | 
|---|
| [2820] | 22 | static int  ListHandlers(); | 
|---|
| [2864] | 23 | //! Finds the appropriate handler and writes the object \b o to fits file \b os | 
|---|
| [2820] | 24 | static void Write(FitsInOutFile& os, AnyDataObj & o); | 
|---|
| [2864] | 25 | //! Finds the appropriate handler and reads the object \b o from fits file \b is | 
|---|
|  | 26 | static void Read(FitsInOutFile& is, AnyDataObj & o); | 
|---|
|  | 27 | //! Finds the appropriate reader for the current HDU and reads the data form \b is | 
|---|
|  | 28 | static FitsHandlerInterface * Read(FitsInOutFile& is); | 
|---|
| [2898] | 29 | //! Scans the fits file and prints information about each HDU on formatted stream \b os | 
|---|
|  | 30 | static int ScanFile(string filename, ostream& os, int slev=0); | 
|---|
|  | 31 | //! Scans the fits file and prints information about each HDU on \b cout | 
|---|
|  | 32 | static inline int ScanFile(string filename, int slev=0) | 
|---|
|  | 33 | { return ScanFile(filename, cout, slev); } | 
|---|
|  | 34 |  | 
|---|
| [2820] | 35 | protected: | 
|---|
| [2864] | 36 | //! Finds the appropriate handler for the object \b o in the list of registered handlers. | 
|---|
| [2820] | 37 | static FitsHandlerInterface* FindHandler(AnyDataObj & o); | 
|---|
| [2864] | 38 | //! Finds the appropriate reader for the current HDU in the list of registered handlers. | 
|---|
|  | 39 | static FitsHandlerInterface* FindReader(FitsInOutFile& is); | 
|---|
| [2820] | 40 | }; | 
|---|
|  | 41 |  | 
|---|
|  | 42 | } // Fin du namespace | 
|---|
|  | 43 |  | 
|---|
|  | 44 | #endif | 
|---|
|  | 45 |  | 
|---|