00001 00002 #ifndef _Q_MONITOR_CONFIG_HANDLER_HH_ 00003 #define _Q_MONITOR_CONFIG_HANDLER_HH_ 00004 00005 #include "QCuore.hh" 00006 #include "QError.hh" 00007 00008 #include <string> 00009 00015 class QMonitorConfigHandler 00016 { 00017 public: 00019 QMonitorConfigHandler(); 00020 00022 virtual ~QMonitorConfigHandler(); 00023 00025 void SetLockFile(const std::string& fileName) 00026 { fLockFileName = fileName; } 00027 00029 void SetCfg(const std::string& fileName) 00030 { fCfgFileName = fileName; } 00031 00033 bool SetDataPath(const std::string& path); 00034 00036 void SetLgChannel(UInt_t lgChannel) 00037 { fLgCh = lgChannel; } 00038 00045 bool WriteCfg(bool force); 00046 00048 bool CheckLockFile(); 00049 00054 bool DumpLockFile(); 00055 00061 bool UnlinkLockFile(); 00062 00067 bool Inhibit(); 00068 00069 const QError& GetError() const { return fError; } 00070 00077 bool CfgUpdated(bool& updated, Int_t& channel); 00078 00079 private: 00080 QError fError; 00081 UInt_t fLgCh; 00082 std::string fLockFileName; 00083 std::string fCfgFileName; 00084 std::string fPath; 00085 time_t fLastUpdate; 00087 void ResetError() 00088 { if(fError != QERR_SUCCESS) fError.Set(QERR_SUCCESS, ""); } 00089 }; 00090 #endif