Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:15:04

0001 #ifndef LMFRUNTAG_H
0002 #define LMFRUNTAG_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 
0013 /**
0014  *   Tag for LMF Run
0015  */
0016 class LMFRunTag : public LMFUnique {
0017 public:
0018   typedef LMFUnique::ResultSet ResultSet;
0019   friend class LMFRunIOV;  // needs permission to write
0020 
0021   LMFRunTag();
0022   LMFRunTag(oracle::occi::Environment *env, oracle::occi::Connection *conn);
0023   LMFRunTag(EcalDBConnection *c);
0024   ~LMFRunTag() override;
0025 
0026   // Methods for user data
0027   std::string getGeneralTag() const;
0028   int getVersion() const;
0029 
0030   LMFRunTag &setGeneralTag(const std::string &tag);
0031   LMFRunTag &setVersion(int v);
0032   LMFRunTag &set(const std::string &tag, int vers) {
0033     setGeneralTag(tag);
0034     setVersion(vers);
0035     return *this;
0036   }
0037 
0038   bool isValid() override;
0039 
0040   // Operators
0041   inline bool operator==(const LMFRunTag &t) const {
0042     return ((getGeneralTag() == t.getGeneralTag()) && (getVersion() == t.getVersion()));
0043   }
0044   inline bool operator!=(const LMFRunTag &t) const {
0045     return ((getGeneralTag() != t.getGeneralTag()) || (getVersion() != t.getVersion()));
0046   }
0047 
0048 private:
0049   // Methods from LMFUnique
0050   std::string fetchIdSql(Statement *stmt) override;
0051   std::string fetchAllSql(Statement *stmt) const override;
0052   std::string setByIDSql(Statement *stmt, int id) override;
0053   void getParameters(ResultSet *rset) override;
0054   LMFUnique *createObject() const override;
0055 };
0056 
0057 #endif