Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-14 02:22:48

0001 #ifndef ONLINEDB_ECALCONDDB_FECONFIGODDWEIGHTINFO_H
0002 #define ONLINEDB_ECALCONDDB_FECONFIGODDWEIGHTINFO_H
0003 
0004 #include <map>
0005 #include <string>
0006 
0007 #include "OnlineDB/EcalCondDB/interface/IODConfig.h"
0008 #include "OnlineDB/EcalCondDB/interface/Tm.h"
0009 #include "OnlineDB/EcalCondDB/interface/DateHandler.h"
0010 
0011 class FEConfigOddWeightInfo : public IODConfig {
0012 public:
0013   friend class EcalCondDBInterface;
0014 
0015   FEConfigOddWeightInfo();
0016   ~FEConfigOddWeightInfo() override;
0017 
0018   // Methods for user data
0019   inline std::string getTable() override { return "FE_CONFIG_WEIGHT2_INFO"; }
0020 
0021   void setNumberOfGroups(int n) { m_ngr = n; }
0022   int getNumberOfGroups() const { return m_ngr; }
0023 
0024   inline void setId(int id) { m_ID = id; }
0025   inline int getId() const { return m_ID; }
0026   // for compatibility
0027   void setID(int id) { setId(id); }
0028   int getID() { return getId(); }
0029   // the tag is already in IODConfig
0030   inline void setVersion(int id) { m_version = id; }
0031   inline int getVersion() const { return m_version; }
0032 
0033   Tm getDBTime() const { return m_db_time; }
0034   void setDBTime(const Tm& x) { m_db_time = x; }
0035 
0036   // Methods from IUniqueDBObject
0037   int fetchID() noexcept(false);
0038   int fetchNextId() noexcept(false);
0039   void setByID(int id) noexcept(false);
0040   void setParameters(const std::map<std::string, std::string>& my_keys_map);
0041 
0042   // operators
0043   inline bool operator==(const FEConfigOddWeightInfo& r) const { return (m_ID == r.m_ID); }
0044   inline bool operator!=(const FEConfigOddWeightInfo& r) const { return !(*this == r); }
0045 
0046 private:
0047   // User data for this IOV
0048   int m_ngr;
0049   int m_ID;
0050   Tm m_db_time;
0051   int m_version;
0052 
0053   void prepareWrite() noexcept(false) override;
0054   void writeDB() noexcept(false);
0055   void clear();
0056   void fetchData(FEConfigOddWeightInfo* result) noexcept(false);
0057   void fetchLastData(FEConfigOddWeightInfo* result) noexcept(false);
0058 };
0059 
0060 #endif