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