00001 #ifndef ODTCCEECONFIG_H 00002 #define ODTCCEECONFIG_H 00003 00004 #include <map> 00005 #include <stdexcept> 00006 #include "OnlineDB/Oracle/interface/Oracle.h" 00007 #include "OnlineDB/EcalCondDB/interface/IODConfig.h" 00008 #define USE_NORM 1 00009 #define USE_CHUN 2 00010 #define USE_BUFF 3 00011 00012 /* Buffer Size */ 00013 #define BUFSIZE 200; 00014 00015 class ODTCCEEConfig : public IODConfig { 00016 public: 00017 friend class EcalCondDBInterface; 00018 ODTCCEEConfig(); 00019 ~ODTCCEEConfig(); 00020 00021 // User data methods 00022 inline std::string getTable() { return "ECAL_TCC_EE_CONFIGURATION"; } 00023 00024 inline void setId(int id) { m_ID = id; } 00025 inline int getId() const { return m_ID; } 00026 00027 inline void setTCCConfigurationFile(std::string x) { m_tcc_ee_file = x; } 00028 inline std::string getTCCConfigurationFile() const { return m_tcc_ee_file; } 00029 inline void setLUTConfigurationFile(std::string x) { m_lut_file = x; } 00030 inline std::string getLUTConfigurationFile() const { return m_lut_file; } 00031 inline void setSLBConfigurationFile(std::string x) { m_slb_file = x; } 00032 inline std::string getSLBConfigurationFile() const { return m_slb_file; } 00033 inline void setTestPatternFileUrl(std::string x) { m_test_url = x; } 00034 inline std::string getTestPatternFileUrl() const { return m_test_url; } 00035 inline void setNTestPatternsToLoad(int id) { m_ntest = id; } 00036 inline int getNTestPatternsToLoad() const { return m_ntest; } 00037 inline void setTriggerPos(int id) { m_trigpos = id; } 00038 inline int getTrigPos() const { return m_trigpos; } 00039 00040 inline void setSLBLatency(int id) { m_slb = id; } 00041 inline int getSLBLatency() const { return m_slb; } 00042 00043 inline void setTCCClob(unsigned char* x) { m_tcc_ee_clob = x; } 00044 inline unsigned char* getTCCClob() const { return m_tcc_ee_clob; } 00045 00046 inline void setLUTClob(unsigned char* x) { m_lut_clob = x; } 00047 inline unsigned char* getLUTClob() const { return m_lut_clob; } 00048 00049 inline void setSLBClob(unsigned char* x) { m_slb_clob = x; } 00050 inline unsigned char* getSLBClob() const { return m_slb_clob; } 00051 00052 void setParameters(std::map<std::string,std::string> my_keys_map); 00053 00054 00055 private: 00056 void prepareWrite() throw(std::runtime_error); 00057 void writeDB() throw(std::runtime_error); 00058 void clear(); 00059 void fetchData(ODTCCEEConfig * result) throw(std::runtime_error); 00060 int fetchID() throw(std::runtime_error); 00061 00062 00063 int fetchNextId() throw(std::runtime_error); 00064 00065 // User data 00066 int m_ID; 00067 unsigned char* m_tcc_ee_clob; 00068 unsigned char* m_lut_clob; 00069 unsigned char* m_slb_clob; 00070 std::string m_tcc_ee_file; 00071 std::string m_lut_file; 00072 std::string m_slb_file; 00073 std::string m_test_url; 00074 int m_ntest; 00075 int m_trigpos; 00076 int m_slb; 00077 unsigned int m_size; 00078 }; 00079 00080 #endif