Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef LMFPRIMVERS_H
0002 #define LMFPRIMVERS_H
0003 
0004 #include <string>
0005 #include <stdexcept>
0006 
0007 /*
0008  Last updated by  Giovanni.Organtini@roma1.infn.it 2010
0009 */
0010 
0011 #include "OnlineDB/EcalCondDB/interface/LMFUnique.h"
0012 #include "OnlineDB/EcalCondDB/interface/EcalDBConnection.h"
0013 
0014 /**
0015  *   LMF version
0016  *
0017  *   Versions cannot be written into the database using these classes,
0018  *   but only via the administration shell. To insert a new version:
0019  *   INSERT INTO <TABLE_NAME> VALUES (<VERS>, DEFAULT, <DESCR>);
0020  *
0021  */
0022 class LMFPrimVers : public LMFUnique {
0023 public:
0024   friend class LMFRunIOV;  // needs permission to write
0025 
0026   LMFPrimVers();
0027   LMFPrimVers(EcalDBConnection *c);
0028   LMFPrimVers(oracle::occi::Environment *env, oracle::occi::Connection *conn);
0029   ~LMFPrimVers() override;
0030 
0031   // Methods for user data
0032   int getVersion() const { return m_ID; }
0033   std::string getDescription() const { return getString("description"); }
0034   void setVersion(int v) { m_ID = v; }
0035   void setDescription(const std::string &s) { setString("description", s); }
0036 
0037   // Operators
0038   inline bool operator==(const LMFPrimVers &t) const { return (getID() == t.getID()); }
0039   inline bool operator!=(const LMFPrimVers &t) const { return (getID() != t.getID()); }
0040 
0041 private:
0042   // Methods from LMFUnique
0043   std::string fetchIdSql(Statement *stmt) override;
0044   std::string fetchAllSql(Statement *stmt) const override;
0045   std::string setByIDSql(Statement *stmt, int id) override;
0046   void getParameters(ResultSet *rset) override;
0047   LMFUnique *createObject() const override;
0048 };
0049 
0050 #endif