QGlobalDataManager.hh
Go to the documentation of this file.00001 #ifndef _Q_GLOBAL_DATA_MANAGER_HH_
00002 #define _Q_GLOBAL_DATA_MANAGER_HH_
00003
00013 #include "QCuore.hh"
00014 #include <string>
00015 #include <map>
00016 #include "QObject.hh"
00017
00018
00019 class TObject;
00020
00021
00022 class QGlobalDataManager
00023 {
00024 public:
00025 QGlobalDataManager();
00026 ~QGlobalDataManager();
00033 void SetTObject(const std::string& key, TObject* obj, const std::string& filename = Q_STRING_DEFAULT);
00040 void SetQObject(const std::string& key, Cuore::QObject* obj, const std::string& filename = Q_STRING_DEFAULT);
00047 void SetInt(const std::string& key, int obj, const std::string& filename = Q_STRING_DEFAULT);
00054 void SetDouble(const std::string& key, double obj, const std::string& filename = Q_STRING_DEFAULT);
00061 void SetBool(const std::string& key, bool obj, const std::string& filename = Q_STRING_DEFAULT);
00068 void SetString(const std::string& key, const std::string &obj, const std::string& filename = Q_STRING_DEFAULT);
00074 const TObject* GetTObject(const std::string& key, const std::string& filename);
00075 TObject* GetTObject(const std::string& key);
00081 const Cuore::QObject* GetQObject(const std::string& key, const std::string& filename);
00082 Cuore::QObject* GetQObject(const std::string& key);
00088 int GetInt(const std::string& key, const std::string& filename = Q_STRING_DEFAULT);
00094 double GetDouble(const std::string& key, const std::string& filename = Q_STRING_DEFAULT);
00100 std::string GetString(const std::string& key, const std::string& filename = Q_STRING_DEFAULT);
00106 bool GetBool(const std::string& key, const std::string& filename = Q_STRING_DEFAULT);
00107
00108
00109 private:
00111 std::map<std::string, TObject*> fTObjectMap;
00112 std::map<std::string, TObject*>::iterator fTObjIter;
00114 std::map<std::string, Cuore::QObject*> fQObjectMap;
00115 std::map<std::string, Cuore::QObject*>::iterator fQObjIter;
00117 std::map<std::string, double> fDoubleMap;
00118 std::map<std::string, double>::iterator fDIter;
00120 std::map<std::string, int> fIntMap;
00121 std::map<std::string, int>::iterator fIIter;
00123 std::map<std::string, bool> fBoolMap;
00124 std::map<std::string, bool>::iterator fBIter;
00126 std::map<std::string, std::string> fStringMap;
00127 std::map<std::string, std::string>::iterator fSIter;
00128
00129 void Clear();
00130 friend class QSequence;
00131 };
00132
00133 #endif