00001 #ifndef ODLTCCYCLE_H 00002 #define ODLTCCYCLE_H 00003 00004 #include <stdexcept> 00005 #include <iostream> 00006 00007 #include "OnlineDB/EcalCondDB/interface/IODConfig.h" 00008 00009 00010 00011 class ODLTCCycle : public IODConfig { 00012 public: 00013 friend class EcalCondDBInterface; 00014 friend class ODEcalCycle; 00015 00016 00017 ODLTCCycle(); 00018 ~ODLTCCycle(); 00019 00020 inline std::string getTable() { return "ECAL_LTC_CYCLE"; } 00021 00022 inline void setId(int id){m_ID=id;} 00023 inline int getId()const{ return m_ID;} ; 00024 00025 // Methods for user data 00026 inline void setLTCConfigurationID(int x){m_ltc_config_id=x;} 00027 inline int getLTCConfigurationID() const{return m_ltc_config_id;} 00028 00029 // Operators 00030 inline bool operator==(const ODLTCCycle &m) const { return ( m_ID == m.m_ID); } 00031 inline bool operator!=(const ODLTCCycle &m) const { return !(*this == m); } 00032 00033 private: 00034 // User data 00035 int m_ID; 00036 int m_ltc_config_id; 00037 void writeDB() throw(std::runtime_error); 00038 void prepareWrite() throw(std::runtime_error); 00039 void clear(); 00040 void fetchData(ODLTCCycle * result) throw(std::runtime_error); 00041 void insertConfig() throw(std::runtime_error); 00042 00043 00044 // Methods from IUniqueDBObject 00045 int fetchID() throw(std::runtime_error); 00046 void setByID(int id) throw(std::runtime_error); 00047 00048 00049 }; 00050 00051 #endif