00001 #ifndef ODDCCCONFIG_H 00002 #define ODDCCCONFIG_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 ODDCCConfig : public IODConfig { 00016 public: 00017 friend class EcalCondDBInterface; 00018 ODDCCConfig(); 00019 ~ODDCCConfig(); 00020 00021 // User data methods 00022 inline std::string getTable() { return "ECAL_DCC_CONFIGURATION"; } 00023 00024 inline void setId(int id) { m_ID = id; } 00025 inline int getId() const { return m_ID; } 00026 inline void setSize(unsigned int id) { m_size = id; } 00027 inline unsigned int getSize() const { return m_size; } 00028 00029 inline void setDCCConfigurationUrl(std::string x) { m_dcc_url = x; } 00030 inline std::string getDCCConfigurationUrl() const { return m_dcc_url; } 00031 00032 inline void setTestPatternFileUrl(std::string x) { m_test_url = x; } 00033 inline std::string getTestPatternFileUrl() const { return m_test_url; } 00034 00035 inline void setNTestPatternsToLoad(int id) { m_ntest = id; } 00036 inline int getNTestPatternsToLoad() const { return m_ntest; } 00037 00038 inline void setSMHalf(int id) { m_sm_half = id; } 00039 inline int getSMHalf() const { return m_sm_half; } 00040 00041 inline void setDCCClob(unsigned char* x) { m_dcc_clob = x; } 00042 inline unsigned char* getDCCClob() const { return m_dcc_clob; } 00043 inline unsigned int getDCCClobSize() const { return m_size; } 00044 inline void setDCCWeightsMode(std::string x) { m_wei = x; } 00045 inline std::string getDCCWeightsMode() const { return m_wei; } 00046 00047 void setParameters(std::map<std::string,std::string> my_keys_map); 00048 00049 private: 00050 void prepareWrite() throw(std::runtime_error); 00051 void writeDB() throw(std::runtime_error); 00052 void clear(); 00053 void fetchData(ODDCCConfig * result) throw(std::runtime_error); 00054 int fetchID() throw(std::runtime_error); 00055 00056 00057 int fetchNextId() throw(std::runtime_error); 00058 00059 // User data 00060 int m_ID; 00061 unsigned char* m_dcc_clob; 00062 std::string m_dcc_url; 00063 std::string m_test_url; 00064 int m_ntest; 00065 int m_sm_half; 00066 unsigned int m_size; 00067 std::string m_wei; 00068 00069 }; 00070 00071 #endif