CMS 3D CMS Logo

LMFRunTag.h
Go to the documentation of this file.
1 #ifndef LMFRUNTAG_H
2 #define LMFRUNTAG_H
3 
4 #include <string>
5 #include <stdexcept>
6 
7 /*
8  Last updated by Giovanni.Organtini@roma1.infn.it 2010
9 */
10 
12 
16 class LMFRunTag : public LMFUnique {
17  public:
19  friend class LMFRunIOV; // needs permission to write
20 
21  LMFRunTag();
22  LMFRunTag(oracle::occi::Environment* env,
23  oracle::occi::Connection* conn);
25  ~LMFRunTag() override;
26 
27  // Methods for user data
28  std::string getGeneralTag() const;
29  int getVersion() const;
30 
32  LMFRunTag& setVersion(int v);
33  LMFRunTag& set(const std::string &tag, int vers) {
34  setGeneralTag(tag);
35  setVersion(vers);
36  return *this;
37  }
38 
39  bool isValid() override;
40 
41  // Operators
42  inline bool operator==(const LMFRunTag &t) const {
43  return ((getGeneralTag() == t.getGeneralTag()) &&
44  (getVersion() == t.getVersion()));
45  }
46  inline bool operator!=(const LMFRunTag &t) const {
47  return ((getGeneralTag() != t.getGeneralTag()) ||
48  (getVersion() != t.getVersion()));
49  }
50 
51  private:
52 
53  // Methods from LMFUnique
54  std::string fetchIdSql(Statement *stmt) override;
55  std::string fetchAllSql(Statement *stmt) const override;
56  std::string setByIDSql(Statement *stmt, int id) override;
57  void getParameters(ResultSet *rset) override;
58  LMFUnique *createObject() const override;
59 
60 };
61 
62 #endif
LMFUnique::ResultSet ResultSet
Definition: LMFRunTag.h:18
std::string fetchIdSql(Statement *stmt) override
Definition: LMFRunTag.cc:51
LMFRunTag & setVersion(int v)
Definition: LMFRunTag.cc:42
bool isValid() override
Definition: LMFRunTag.cc:87
std::string getGeneralTag() const
Definition: LMFRunTag.cc:31
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19
bool operator==(const LMFRunTag &t) const
Definition: LMFRunTag.h:42
std::string fetchAllSql(Statement *stmt) const override
Definition: LMFRunTag.cc:81
~LMFRunTag() override
Definition: LMFRunTag.cc:27
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
LMFRunTag & setGeneralTag(const std::string &tag)
Definition: LMFRunTag.cc:36
int getVersion() const
Definition: LMFRunTag.cc:47
std::string setByIDSql(Statement *stmt, int id) override
Definition: LMFRunTag.cc:60
bool operator!=(const LMFRunTag &t) const
Definition: LMFRunTag.h:46
LMFRunTag()
Definition: LMFRunTag.cc:6
void getParameters(ResultSet *rset) override
Definition: LMFRunTag.cc:70
LMFUnique * createObject() const override
Definition: LMFRunTag.cc:75