00001 #ifndef ODRUNCONFIGCYCLEINFO_H 00002 #define ODRUNCONFIGCYCLEINFO_H 00003 00004 #include <stdexcept> 00005 #include <iostream> 00006 00007 00008 #include "OnlineDB/EcalCondDB/interface/RunModeDef.h" 00009 #include "OnlineDB/EcalCondDB/interface/RunTypeDef.h" 00010 #include "OnlineDB/EcalCondDB/interface/RunSeqDef.h" 00011 #include "OnlineDB/EcalCondDB/interface/IODConfig.h" 00012 00013 00014 class ODRunConfigCycleInfo : public IODConfig { 00015 public: 00016 friend class EcalCondDBInterface; 00017 friend class ODEcalCycle; 00018 00019 ODRunConfigCycleInfo(); 00020 ~ODRunConfigCycleInfo(); 00021 00022 inline std::string getTable() { return "ECAL_CYCLE_DAT"; } 00023 00024 // Methods for user data 00025 inline void setId(int id) { m_ID = id; } 00026 inline int getId() const { return m_ID; } 00027 00028 00029 00030 void setDescription(std::string x) { m_description = x;} 00031 std::string getDescription() const{ return m_description;} 00032 // 00033 void setTag(std::string x) { m_tag = x;} 00034 std::string getTag() const{ return m_tag;} 00035 // 00036 void setSequenceID(int x) { m_sequence_id = x;} 00037 int getSequenceID() const{ return m_sequence_id;} 00038 // 00039 void setCycleNumber(int n){ m_cycle_num = n; } 00040 int getCycleNumber()const {return m_cycle_num; } 00041 // 00042 00043 00044 00045 // operators 00046 inline bool operator==(const ODRunConfigCycleInfo &r) const { return (m_ID == r.m_ID ); } 00047 inline bool operator!=(const ODRunConfigCycleInfo &r) const { return !(*this == r); } 00048 00049 private: 00050 // User data for this IOV 00051 int m_ID; 00052 int m_sequence_id; 00053 int m_cycle_num; 00054 std::string m_tag; 00055 std::string m_description; 00056 00057 void prepareWrite() throw(std::runtime_error); 00058 void writeDB() throw(std::runtime_error); 00059 void clear(); 00060 void fetchData(ODRunConfigCycleInfo * result) throw(std::runtime_error); 00061 void insertConfig() throw(std::runtime_error); 00062 00063 00064 // Methods from IUniqueDBObject 00065 int fetchID() throw(std::runtime_error); // fetches the Cycle by the seq_id and cycle_num 00066 int fetchIDLast() throw(std::runtime_error); // fetches the Cycle by the seq_id and cycle_num 00067 void setByID(int id) throw(std::runtime_error); 00068 00069 }; 00070 00071 00072 00073 #endif