00001 #ifndef _L_ROOT_GLOBAL_READER_HH_ 00002 #define _L_ROOT_GLOBAL_READER_HH_ 00003 00012 #include "QGlobalReader.hh" 00013 #include "QCuoreR.hh" 00014 #include "TFile.h" 00015 #include <map> 00016 00017 class LRootGlobalReader : public QGlobalReader 00018 { 00019 public: 00020 LRootGlobalReader(); 00021 00022 ~LRootGlobalReader(); 00023 00024 QError Open(const std::string& filename, const std::string& opt = ""); 00025 00026 QError Close(); 00027 00028 const QObject* GetQObject(const std::string& name) const; 00029 00030 const TObject* GetTObject(const std::string& name) const; 00031 00032 double GetDouble(const std::string& name) const; 00033 00034 int GetInt(const std::string& name) const; 00035 00036 float GetFloat(const std::string& name) const; 00037 00038 bool GetBool(const std::string& name) const; 00039 00040 std::string GetString(const std::string& name) const; 00041 00042 private: 00043 bool ReadingIsSafe() const; 00044 std::string GetFullPath(const std::string& name) const; 00045 std::string fFileName; 00046 mutable TFile* fFile; 00047 std::map<std::string, QObject*>* fQObjectCache; 00048 bool fIsMRootFileReader; 00049 }; 00050 00051 #endif