00001 #ifndef ODTTCFCONFIG_H 00002 #define ODTTCFCONFIG_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 ODTTCFConfig : public IODConfig { 00016 public: 00017 friend class EcalCondDBInterface; 00018 ODTTCFConfig(); 00019 ~ODTTCFConfig(); 00020 00021 // User data methods 00022 inline std::string getTable() { return "ECAL_TTCF_CONFIGURATION"; } 00023 inline void setSize(unsigned int id) { m_size = id; } 00024 inline unsigned int getSize() const { return m_size; } 00025 00026 inline void setId(int id) { m_ID = id; } 00027 inline int getId() const { return m_ID; } 00028 00029 inline void setTTCFConfigurationFile(std::string x) { m_ttcf_file = x; } 00030 inline std::string getTTCFConfigurationFile() const { return m_ttcf_file; } 00031 00032 inline void setTTCFClob(unsigned char* x) { m_ttcf_clob = x; } 00033 inline unsigned char* getTTCFClob() const { return m_ttcf_clob; } 00034 00035 00036 void setParameters(std::map<string,string> my_keys_map); 00037 00038 private: 00039 void prepareWrite() throw(std::runtime_error); 00040 00041 void writeDB() throw(std::runtime_error); 00042 00043 void clear(); 00044 00045 void fetchData(ODTTCFConfig * result) throw(std::runtime_error); 00046 00047 int fetchID() throw(std::runtime_error); 00048 00049 00050 00051 int fetchNextId() throw(std::runtime_error); 00052 00053 // User data 00054 int m_ID; 00055 unsigned char* m_ttcf_clob; 00056 unsigned int m_size; 00057 std::string m_ttcf_file; 00058 00059 }; 00060 00061 #endif