CMS 3D CMS Logo

LMFLmrSubIOV.h
Go to the documentation of this file.
1 #ifndef LMFLMRSUBIOV_H
2 #define LMFLMRSUBIOV_H
3 
4 /*
5  Last updated by Giovanni.Organtini@roma1.infn.it 2010
6  */
7 
8 #include <map>
9 
12 
13 class LMFLmrSubIOV : public LMFUnique {
14  public:
15  friend class EcalCondDBInterface;
16 
17  LMFLmrSubIOV();
19  LMFLmrSubIOV(oracle::occi::Environment* env,
20  oracle::occi::Connection* conn);
21  ~LMFLmrSubIOV() override;
22 
23  LMFLmrSubIOV& setLMFIOV(const LMFIOV &iov);
24  LMFLmrSubIOV& setLMFIOV(int i);
25  LMFLmrSubIOV& setTimes(const Tm& t1, const Tm& t2, const Tm& t3);
26  LMFLmrSubIOV& setTimes(const std::vector<Tm>& t);
27  LMFLmrSubIOV& setTimes(Tm *t); // array of three components
28 
29  int getLMFIOVID() const {
30  return m_lmfIOV;
31  };
32  LMFIOV getLMFIOV() const {
33  LMFIOV iov(m_env, m_conn);
34  iov.setByID(m_lmfIOV);
35  return iov;
36  };
37  inline void getTimes(Tm *t1, Tm *t2, Tm *t3) const {
38  *t1 = m_t[0];
39  *t2 = m_t[1];
40  *t3 = m_t[2];
41  }
42  std::vector<Tm> getTimes() const {
43  std::vector<Tm> v;
44  v.push_back(m_t[0]);
45  v.push_back(m_t[1]);
46  v.push_back(m_t[2]);
47  return v;
48  }
49  inline void getTimes(Tm *t) const {
50  t[0] = m_t[0];
51  t[1] = m_t[1];
52  t[2] = m_t[2];
53  }
54  inline Tm getTime(int i) {
55  Tm t;
56  if ((i > 0) && (i < 4)) {
57  t = m_t[i - 1];
58  }
59  return t;
60  }
61  inline Tm getT1() {
62  return m_t[0];
63  }
64  inline Tm getT2() {
65  return m_t[1];
66  }
67  inline Tm getT3() {
68  return m_t[2];
69  }
70 
71  std::list<int> getIOVIDsLaterThan(const Tm &t) noexcept(false);
72  std::list<int> getIOVIDsLaterThan(const Tm &tmin, const Tm &tmax) noexcept(false);
73  std::list<int> getIOVIDsLaterThan(const Tm &t, int howMany) noexcept(false);
74  std::list<int> getIOVIDsLaterThan(const Tm &t, const Tm &tmax, int howMany) noexcept(false);
75 
76  // Operators
77  inline bool operator==(const LMFLmrSubIOV &m) const
78  {
79  return ( (m_lmfIOV == m.m_lmfIOV) &&
80  (m_t[0] == m.m_t[0]) &&
81  (m_t[1] == m.m_t[1]) &&
82  (m_t[2] == m.m_t[2]));
83  }
84 
85  inline bool operator!=(const LMFLmrSubIOV &m) const { return !(*this == m); }
86 
87  std::list<LMFLmrSubIOV> fetchByLMFIOV(const LMFIOV &iov);
88 
89  private:
90  int m_lmfIOV;
91  Tm m_t[3];
92 
94  std::string setByIDSql(Statement *stmt, int id) override;
96  void getParameters(ResultSet *rset) override;
97  void init();
98 };
99 
100 #endif
std::list< int > getIOVIDsLaterThan(const Tm &t) noexcept(false)
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Tm getTime(int i)
Definition: LMFLmrSubIOV.h:54
#define noexcept
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:286
void getTimes(Tm *t) const
Definition: LMFLmrSubIOV.h:49
LMFIOV getLMFIOV() const
Definition: LMFLmrSubIOV.h:32
std::string setByIDSql(Statement *stmt, int id) override
Definition: LMFLmrSubIOV.cc:81
bool operator!=(const LMFLmrSubIOV &m) const
Definition: LMFLmrSubIOV.h:85
oracle::occi::Connection * conn
LMFLmrSubIOV & setTimes(const Tm &t1, const Tm &t2, const Tm &t3)
Definition: LMFLmrSubIOV.cc:48
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
void getTimes(Tm *t1, Tm *t2, Tm *t3) const
Definition: LMFLmrSubIOV.h:37
bool operator==(const LMFLmrSubIOV &m) const
Definition: LMFLmrSubIOV.h:77
std::string writeDBSql(Statement *stmt) override
Definition: LMFLmrSubIOV.cc:90
Definition: LMFIOV.h:17
static const double tmax[3]
std::vector< Tm > getTimes() const
Definition: LMFLmrSubIOV.h:42
oracle::occi::Statement * stmt
std::list< LMFLmrSubIOV > fetchByLMFIOV(const LMFIOV &iov)
Definition: Tm.h:13
std::string fetchIdSql(Statement *stmt) override
Definition: LMFLmrSubIOV.cc:55
int getLMFIOVID() const
Definition: LMFLmrSubIOV.h:29
void getParameters(ResultSet *rset) override
LMFLmrSubIOV & setLMFIOV(const LMFIOV &iov)
Definition: LMFLmrSubIOV.cc:32
~LMFLmrSubIOV() override
Definition: LMFLmrSubIOV.cc:29