Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:53

0001 #ifndef ODSRPCONFIG_H
0002 #define ODSRPCONFIG_H
0003 
0004 #include <map>
0005 #include <stdexcept>
0006 #include "OnlineDB/Oracle/interface/Oracle.h"
0007 #include "OnlineDB/EcalCondDB/interface/IODConfig.h"
0008 
0009 #define USE_NORM 1
0010 #define USE_CHUN 2
0011 #define USE_BUFF 3
0012 
0013 /* Buffer Size */
0014 #define BUFSIZE 200;
0015 
0016 class ODSRPConfig : public IODConfig {
0017 public:
0018   friend class EcalCondDBInterface;
0019   ODSRPConfig();
0020   ~ODSRPConfig() override;
0021 
0022   // User data methods
0023   inline std::string getTable() override { return "ECAL_SRP_CONFIGURATION"; }
0024 
0025   inline void setId(int id) { m_ID = id; }
0026   inline int getId() const { return m_ID; }
0027 
0028   inline void setDebugMode(int x) { m_debug = x; }
0029   inline int getDebugMode() const { return m_debug; }
0030 
0031   inline void setDummyMode(int x) { m_dummy = x; }
0032   inline int getDummyMode() const { return m_dummy; }
0033 
0034   inline void setPatternDirectory(std::string x) { m_patdir = x; }
0035   inline std::string getPatternDirectory() const { return m_patdir; }
0036 
0037   inline void setAutomaticMasks(int x) { m_auto = x; }
0038   inline int getAutomaticMasks() const { return m_auto; }
0039 
0040   inline void setAutomaticSrpSelect(int x) { m_auto_srp = x; }
0041   inline int getAutomaticSrpSelect() const { return m_auto_srp; }
0042 
0043   inline void setSRP0BunchAdjustPosition(int x) { m_bnch = x; }
0044   inline int getSRP0BunchAdjustPosition() const { return m_bnch; }
0045 
0046   inline void setConfigFile(std::string x) { m_file = x; }
0047   inline std::string getConfigFile() const { return m_file; }
0048 
0049   inline void setSRPClob(unsigned char* x) { m_srp_clob = x; }
0050   inline unsigned char* getSRPClob() const { return m_srp_clob; }
0051   inline unsigned int getSRPClobSize() const { return m_size; }
0052 
0053   void setParameters(const std::map<std::string, std::string>& my_keys_map);
0054 
0055 private:
0056   void prepareWrite() noexcept(false) override;
0057   void writeDB() noexcept(false);
0058   void clear();
0059   void fetchData(ODSRPConfig* result) noexcept(false);
0060   int fetchID() noexcept(false);
0061 
0062   int fetchNextId() noexcept(false);
0063 
0064   // User data
0065   int m_ID;
0066   unsigned char* m_srp_clob;
0067   int m_debug;
0068   int m_dummy;
0069   std::string m_file;
0070   std::string m_patdir;
0071   int m_auto, m_auto_srp;
0072   int m_bnch;
0073   unsigned int m_size;
0074 };
0075 
0076 #endif