test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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,
29  oracle::occi::Connection* conn);
30  ~LMFPrimVers();
31 
32  // Methods for user data
33  int getVersion() const { return m_ID; }
34  std::string getDescription() const { return getString("description"); }
35  void setVersion(int v) { m_ID = v; }
36  void setDescription(const std::string &s) { setString("description", s); }
37 
38  // Operators
39  inline bool operator==(const LMFPrimVers &t) const {
40  return (getID() == t.getID());
41  }
42  inline bool operator!=(const LMFPrimVers &t) const {
43  return (getID() != t.getID());
44  }
45 
46  private:
47  // Methods from LMFUnique
49  std::string fetchAllSql(Statement *stmt) const;
50  std::string setByIDSql(Statement *stmt, int id);
51  void getParameters(ResultSet *rset);
52  LMFUnique *createObject() const;
53 };
54 
55 #endif
void setDescription(const std::string &s)
Definition: LMFPrimVers.h:36
int getID() const
Definition: LMFUnique.h:52
std::string getDescription() const
Definition: LMFPrimVers.h:34
std::string fetchIdSql(Statement *stmt)
Definition: LMFPrimVers.cc:27
std::string setByIDSql(Statement *stmt, int id)
Definition: LMFPrimVers.cc:31
void getParameters(ResultSet *rset)
Definition: LMFPrimVers.cc:40
int getVersion() const
Definition: LMFPrimVers.h:33
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
bool operator!=(const LMFPrimVers &t) const
Definition: LMFPrimVers.h:42
void setVersion(int v)
Definition: LMFPrimVers.h:35
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:15
bool operator==(const LMFPrimVers &t) const
Definition: LMFPrimVers.h:39
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
std::string fetchAllSql(Statement *stmt) const
Definition: LMFPrimVers.cc:50
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:194
LMFUnique * createObject() const
Definition: LMFPrimVers.cc:44