Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:54

0001 #ifndef MODCCSHFDAT_H
0002 #define MODCCSHFDAT_H
0003 
0004 #include <map>
0005 #include <stdexcept>
0006 
0007 #include <string>
0008 #include <fstream>
0009 #include <iostream>
0010 #include <cstdio>
0011 #include <cstring>
0012 
0013 #include "OnlineDB/Oracle/interface/Oracle.h"
0014 
0015 #include "OnlineDB/EcalCondDB/interface/IDataItem.h"
0016 #include "OnlineDB/EcalCondDB/interface/MODRunIOV.h"
0017 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
0018 
0019 class MODCCSHFDat : public IDataItem {
0020 public:
0021   typedef oracle::occi::Clob Clob;
0022   friend class EcalCondDBInterface;
0023   MODCCSHFDat();
0024   ~MODCCSHFDat() override;
0025 
0026   // User data methods
0027   inline std::string getTable() override { return "OD_CCS_HF_DAT"; }
0028 
0029   inline void setClob(unsigned char* x) { m_clob = x; }
0030   inline unsigned char* getClob() const { return m_clob; }
0031 
0032   inline void setSize(unsigned int id) { m_size = id; }
0033   inline unsigned int getSize() const { return m_size; }
0034 
0035   inline void setTest(int id) { testing = id; }
0036   inline int getTest() const { return testing; }
0037 
0038   void setFile(std::string x);
0039   inline std::string getFile() const { return m_file; }
0040 
0041 private:
0042   void prepareWrite() noexcept(false) override;
0043 
0044   void writeDB(const EcalLogicID* ecid, const MODCCSHFDat* item, MODRunIOV* iov) noexcept(false);
0045 
0046   void writeArrayDB(const std::map<EcalLogicID, MODCCSHFDat>* data, MODRunIOV* iov) noexcept(false);
0047 
0048   void fetchData(std::map<EcalLogicID, MODCCSHFDat>* fillMap, MODRunIOV* iov) noexcept(false);
0049 
0050   // User data
0051   unsigned char* m_clob;
0052   unsigned int m_size;
0053   std::string m_file;
0054   int testing;
0055   unsigned char* readClob(Clob& clob, int size) noexcept(false);
0056   void populateClob(Clob& clob, std::string fname, unsigned int clob_size) noexcept(false);
0057 };
0058 
0059 #endif