| 1 | // Classe d'initialisation du module FitsIOServer | 
|---|
| 2 |  | 
|---|
| 3 | #include "sopnamsp.h" | 
|---|
| 4 | #include "machdefs.h" | 
|---|
| 5 | #include "fiosinit.h" | 
|---|
| 6 | #include "fitsmanager.h" | 
|---|
| 7 | #include "fitshdtable.h" | 
|---|
| 8 | #include "fitsarrhand.h" | 
|---|
| 9 |  | 
|---|
| 10 | #include "fitsntuple.h" | 
|---|
| 11 | #include "fitsspherehealpix.h" | 
|---|
| 12 | #include "fitsspherethetaphi.h" | 
|---|
| 13 | #include "fitslocalmap.h" | 
|---|
| 14 | #include "fitshistos.h" | 
|---|
| 15 | #include "fitsgenedata.h" | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | #include <iostream> | 
|---|
| 19 |  | 
|---|
| 20 | /*! | 
|---|
| 21 | \class SOPHYA::FitsIOServerInitiator | 
|---|
| 22 | \ingroup FitsIOServer | 
|---|
| 23 | Perform registration of fits handlers. | 
|---|
| 24 | \sa SOPHYA::FitsManager | 
|---|
| 25 | */ | 
|---|
| 26 | int FitsIOServerInitiator::FgInit = 0; | 
|---|
| 27 |  | 
|---|
| 28 | // ---> Reporter ce numero de version ds fitsinoutfile.h (methode Version()) | 
|---|
| 29 | // Module version number - 2.0 , Jul 2006 | 
|---|
| 30 | // Module version number - 2.1 , Fev 2007 (version ll (LONGLONG) de cfitsio) | 
|---|
| 31 | // Module version number - 2.12 , Avr 2008 (Lecture-ecriture tableaux avec offset) | 
|---|
| 32 | // Module version number - 2.2 , Aout 2010 | 
|---|
| 33 |  | 
|---|
| 34 | #define MOD_VERS   2.2 | 
|---|
| 35 |  | 
|---|
| 36 | FitsIOServerInitiator::FitsIOServerInitiator() | 
|---|
| 37 | : SophyaInitiator() | 
|---|
| 38 | { | 
|---|
| 39 | FitsIOServerInitiator::FgInit++; | 
|---|
| 40 | if (FitsIOServerInitiator::FgInit > 1)  return; | 
|---|
| 41 |  | 
|---|
| 42 | //   Enregistrement des classes FitsHandler | 
|---|
| 43 | //DBG   cout << " ---- FitsIOServerInitiator / DEBUG ---- debut RegisterHandler " << endl; | 
|---|
| 44 | FitsManager::RegisterHandler(new FitsArrayHandler<int_2> , 1, "TArray<int_2>"); | 
|---|
| 45 | FitsManager::RegisterHandler(new FitsArrayHandler<int_4> , 1, "TArray<int_4> "); | 
|---|
| 46 | // Si c-fitsio supporte les HDU_IMAGE avec data de type int_8 (BITPIX=64) | 
|---|
| 47 | #ifdef LONGLONG_IMG | 
|---|
| 48 | FitsManager::RegisterHandler(new FitsArrayHandler<int_8> , 1, "TArray<int_8> "); | 
|---|
| 49 | #endif | 
|---|
| 50 | FitsManager::RegisterHandler(new FitsArrayHandler<r_4> , 1, "TArray<r_4>"); | 
|---|
| 51 | FitsManager::RegisterHandler(new FitsArrayHandler< r_8 > , 1, "TArray<r_8>"); | 
|---|
| 52 |  | 
|---|
| 53 | FitsManager::RegisterHandler(new FitsHandler<BaseDataTable>, 1, "DataTable"); | 
|---|
| 54 |  | 
|---|
| 55 | // Enregistrement des classes heritant de FitsIOHandler | 
|---|
| 56 | FitsManager::RegisterHandler(new FITS_NTuple, 0, "NTuple"); | 
|---|
| 57 | FitsManager::RegisterHandler(new FitsHandler<Histo>, 0, "Histo"); | 
|---|
| 58 | FitsManager::RegisterHandler(new FitsHandler<Histo2D>, 0, "Histo2D"); | 
|---|
| 59 | FitsManager::RegisterHandler(new FitsHandler<GeneralFitData>, 0, "GeneralFitData"); | 
|---|
| 60 |  | 
|---|
| 61 | FitsManager::RegisterHandler(new FITS_SphereHEALPix<r_4> , 0, "SphereHEALPix<r_4>"); | 
|---|
| 62 | FitsManager::RegisterHandler(new FITS_SphereHEALPix<r_8> , 0, "SphereHEALPix<r_8>"); | 
|---|
| 63 | FitsManager::RegisterHandler(new FITS_SphereHEALPix<int_4> , 0, "SphereHEALPix<int_4>"); | 
|---|
| 64 |  | 
|---|
| 65 | FitsManager::RegisterHandler(new FITS_SphereThetaPhi<r_4> , 0, "SphereThetaPhi<r_4>"); | 
|---|
| 66 | FitsManager::RegisterHandler(new FITS_SphereThetaPhi<r_8> , 0, "SphereThetaPhi<r_8>"); | 
|---|
| 67 | FitsManager::RegisterHandler(new FITS_SphereThetaPhi<int_4> , 0, "SphereThetaPhi<int_4>"); | 
|---|
| 68 |  | 
|---|
| 69 | FitsManager::RegisterHandler(new FITS_LocalMap<r_4> , 0, "LocalMap<r_4>"); | 
|---|
| 70 | FitsManager::RegisterHandler(new FITS_LocalMap<r_8> , 0, "LocalMap<r_8>"); | 
|---|
| 71 | FitsManager::RegisterHandler(new FITS_LocalMap<int_4> , 0, "LocalMap<int_4>"); | 
|---|
| 72 |  | 
|---|
| 73 | //DBG  cout << " ---- FitsIOServerInitiator / DEBUG ---- ListHandlers() : " << endl; | 
|---|
| 74 | //DBG  FitsManager::ListHandlers(); | 
|---|
| 75 |  | 
|---|
| 76 | SophyaInitiator::RegisterModule("FitsIOServer", MOD_VERS);  // Module name and version number registration | 
|---|
| 77 | } | 
|---|
| 78 |  | 
|---|
| 79 | FitsIOServerInitiator::~FitsIOServerInitiator() | 
|---|
| 80 | { | 
|---|
| 81 | FitsIOServerInitiator::FgInit--; | 
|---|
| 82 | } | 
|---|
| 83 |  | 
|---|
| 84 |  | 
|---|
| 85 | // On met un objet initiator en statique, pour les loaders qui savent | 
|---|
| 86 | // appeler le constructeur des objets statiques | 
|---|
| 87 | // #if !defined(Darwin) | 
|---|
| 88 | // Probleme rencontre de nouveau en Juillet 2006 sur MacOS : | 
|---|
| 89 | // La presence de l'objet statique fait planter les progs linkes libextsophya.dylib | 
|---|
| 90 | // static FitsIOServerInitiator s_fios_init_; | 
|---|
| 91 | // #endif | 
|---|
| 92 |  | 
|---|