CMS 3D CMS Logo

LMFPrimVers.h
Go to the documentation of this file.
1 #ifndef LMFPRIMVERS_H
2 #define LMFPRIMVERS_H
3 
4 #include <string>
5 #include <stdexcept>
6 
7 /*
8  Last updated by Giovanni.Organtini@roma1.infn.it 2010
9 */
10 
13 
22 class LMFPrimVers : public LMFUnique {
23 public:
24  friend class LMFRunIOV; // needs permission to write
25 
26  LMFPrimVers();
28  LMFPrimVers(oracle::occi::Environment *env, oracle::occi::Connection *conn);
29  ~LMFPrimVers() override;
30 
31  // Methods for user data
32  int getVersion() const { return m_ID; }
33  std::string getDescription() const { return getString("description"); }
34  void setVersion(int v) { m_ID = v; }
35  void setDescription(const std::string &s) { setString("description", s); }
36 
37  // Operators
38  inline bool operator==(const LMFPrimVers &t) const { return (getID() == t.getID()); }
39  inline bool operator!=(const LMFPrimVers &t) const { return (getID() != t.getID()); }
40 
41 private:
42  // Methods from LMFUnique
43  std::string fetchIdSql(Statement *stmt) override;
44  std::string fetchAllSql(Statement *stmt) const override;
45  std::string setByIDSql(Statement *stmt, int id) override;
46  void getParameters(ResultSet *rset) override;
47  LMFUnique *createObject() const override;
48 };
49 
50 #endif
void setDescription(const std::string &s)
Definition: LMFPrimVers.h:35
std::string fetchIdSql(Statement *stmt) override
Definition: LMFPrimVers.cc:23
int getID() const
Definition: LMFUnique.h:58
std::string getDescription() const
Definition: LMFPrimVers.h:33
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:23
std::string setByIDSql(Statement *stmt, int id) override
Definition: LMFPrimVers.cc:25
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
oracle::occi::Statement Statement
Definition: LMFUnique.h:24
std::string fetchAllSql(Statement *stmt) const override
Definition: LMFPrimVers.cc:42
void setVersion(int v)
Definition: LMFPrimVers.h:34
bool operator==(const LMFPrimVers &t) const
Definition: LMFPrimVers.h:38
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14
LMFUnique * createObject() const override
Definition: LMFPrimVers.cc:36
void getParameters(ResultSet *rset) override
Definition: LMFPrimVers.cc:34
bool operator!=(const LMFPrimVers &t) const
Definition: LMFPrimVers.h:39
~LMFPrimVers() override
Definition: LMFPrimVers.cc:21
int getVersion() const
Definition: LMFPrimVers.h:32