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 00044 void setParameters(std::map<string,string> my_keys_map); 00045 00046 private: 00047 void prepareWrite() throw(std::runtime_error); 00048 void writeDB() throw(std::runtime_error); 00049 void clear(); 00050 void fetchData(ODDCCConfig * result) throw(std::runtime_error); 00051 int fetchID() throw(std::runtime_error); 00052 00053 00054 int fetchNextId() throw(std::runtime_error); 00055 00056 // User data 00057 int m_ID; 00058 unsigned char* m_dcc_clob; 00059 std::string m_dcc_url; 00060 std::string m_test_url; 00061 int m_ntest; 00062 int m_sm_half; 00063 unsigned int m_size; 00064 00065 }; 00066 00067 #endif