CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/OnlineDB/EcalCondDB/interface/LMFPrimVers.h

Go to the documentation of this file.
00001 #ifndef LMFPRIMVERS_H
00002 #define LMFPRIMVERS_H
00003 
00004 #include <string>
00005 #include <stdexcept>
00006 
00007 /*
00008  Copyright (c) Giovanni.Organtini@roma1.infn.it 2010
00009 */
00010 
00011 #include "OnlineDB/EcalCondDB/interface/LMFUnique.h"
00012 #include "OnlineDB/EcalCondDB/interface/EcalDBConnection.h"
00013 
00022 class LMFPrimVers : public LMFUnique {
00023  public:
00024   friend class LMFRunIOV;  // needs permission to write
00025 
00026   LMFPrimVers();
00027   LMFPrimVers(EcalDBConnection *c);
00028   LMFPrimVers(oracle::occi::Environment* env,
00029               oracle::occi::Connection* conn);
00030   ~LMFPrimVers();
00031 
00032   // Methods for user data
00033   int getVersion() const { return m_ID; }
00034   std::string getDescription() const { return getString("description"); }
00035   void setVersion(int v) { m_ID = v; }
00036   void setDescription(const std::string &s) { setString("description", s); }
00037 
00038   // Operators
00039   inline bool operator==(const LMFPrimVers &t) const { 
00040     return (getID() == t.getID());
00041   }
00042   inline bool operator!=(const LMFPrimVers &t) const { 
00043     return (getID() != t.getID());
00044   }
00045 
00046  private:
00047   // Methods from LMFUnique
00048   std::string fetchIdSql(Statement *stmt);
00049   std::string fetchAllSql(Statement *stmt) const;
00050   std::string setByIDSql(Statement *stmt, int id);
00051   void getParameters(ResultSet *rset);
00052   LMFUnique *createObject() const;
00053 };
00054 
00055 #endif