00001 /* -*- c++ -*- */ 00002 00014 #ifndef FitsController_H 00015 #define FitsController_H 00016 00017 #include "pattern/libhippo.h" 00018 00019 #include <map> 00020 #include <string> 00021 #include <vector> 00022 00023 class FitsFile; 00024 class DataSource; 00025 class PlotterBase; 00026 00031 class MDL_HIPPOPLOT_API FitsController 00032 { 00033 00034 private: 00035 00038 std::map < std::string, FitsFile * > m_file_map; 00039 00042 mutable std::string m_version; 00043 00046 static FitsController * s_instance; 00047 00050 std::vector < std::string > m_ntuple_names; 00051 00054 void closeFile ( const std::string & name ); 00055 00056 public: 00057 00060 static FitsController * instance (); 00061 00064 virtual ~FitsController(); 00065 00068 const std::string & version () const; 00069 00074 FitsFile * openFile ( const std::string & file ); 00075 00079 const std::vector < std::string > & 00080 getNTupleNames ( const std::string & file_name ); 00081 00087 DataSource * createNTuple ( const std::string & filename, 00088 const std::string & name ); 00089 00098 DataSource * createNTuple ( const std::string & filename, 00099 const std::string & name, 00100 int index ); 00101 00106 void checkForImage ( PlotterBase * plotter, 00107 const DataSource & source, 00108 const std::vector < std::string > & binding ); 00109 00110 }; 00111 00112 #endif // FitsController_H