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, oracle::occi::Connection *conn);
20  ~LMFLmrSubIOV() override;
21 
22  LMFLmrSubIOV &setLMFIOV(const LMFIOV &iov);
23  LMFLmrSubIOV &setLMFIOV(int i);
24  LMFLmrSubIOV &setTimes(const Tm &t1, const Tm &t2, const Tm &t3);
25  LMFLmrSubIOV &setTimes(const std::vector<Tm> &t);
26  LMFLmrSubIOV &setTimes(Tm *t); // array of three components
27 
28  int getLMFIOVID() const { return m_lmfIOV; };
29  LMFIOV getLMFIOV() const {
30  LMFIOV iov(m_env, m_conn);
31  iov.setByID(m_lmfIOV);
32  return iov;
33  };
34  inline void getTimes(Tm *t1, Tm *t2, Tm *t3) const {
35  *t1 = m_t[0];
36  *t2 = m_t[1];
37  *t3 = m_t[2];
38  }
39  std::vector<Tm> getTimes() const {
40  std::vector<Tm> v;
41  v.push_back(m_t[0]);
42  v.push_back(m_t[1]);
43  v.push_back(m_t[2]);
44  return v;
45  }
46  inline void getTimes(Tm *t) const {
47  t[0] = m_t[0];
48  t[1] = m_t[1];
49  t[2] = m_t[2];
50  }
51  inline Tm getTime(int i) {
52  Tm t;
53  if ((i > 0) && (i < 4)) {
54  t = m_t[i - 1];
55  }
56  return t;
57  }
58  inline Tm getT1() { return m_t[0]; }
59  inline Tm getT2() { return m_t[1]; }
60  inline Tm getT3() { return m_t[2]; }
61 
62  std::list<int> getIOVIDsLaterThan(const Tm &t) noexcept(false);
63  std::list<int> getIOVIDsLaterThan(const Tm &tmin, const Tm &tmax) noexcept(false);
64  std::list<int> getIOVIDsLaterThan(const Tm &t, int howMany) noexcept(false);
65  std::list<int> getIOVIDsLaterThan(const Tm &t, const Tm &tmax, int howMany) noexcept(false);
66 
67  // Operators
68  inline bool operator==(const LMFLmrSubIOV &m) const {
69  return ((m_lmfIOV == m.m_lmfIOV) && (m_t[0] == m.m_t[0]) && (m_t[1] == m.m_t[1]) && (m_t[2] == m.m_t[2]));
70  }
71 
72  inline bool operator!=(const LMFLmrSubIOV &m) const { return !(*this == m); }
73 
74  std::list<LMFLmrSubIOV> fetchByLMFIOV(const LMFIOV &iov);
75 
76 private:
77  int m_lmfIOV;
78  Tm m_t[3];
79 
81  std::string setByIDSql(Statement *stmt, int id) override;
83  void getParameters(ResultSet *rset) override;
84  void init();
85 };
86 
87 #endif
std::list< int > getIOVIDsLaterThan(const Tm &t) noexcept(false)
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
Tm getTime(int i)
Definition: LMFLmrSubIOV.h:51
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
void getTimes(Tm *t) const
Definition: LMFLmrSubIOV.h:46
LMFIOV getLMFIOV() const
Definition: LMFLmrSubIOV.h:29
std::string setByIDSql(Statement *stmt, int id) override
Definition: LMFLmrSubIOV.cc:73
bool operator!=(const LMFLmrSubIOV &m) const
Definition: LMFLmrSubIOV.h:72
LMFLmrSubIOV & setTimes(const Tm &t1, const Tm &t2, const Tm &t3)
Definition: LMFLmrSubIOV.cc:40
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
void getTimes(Tm *t1, Tm *t2, Tm *t3) const
Definition: LMFLmrSubIOV.h:34
bool operator==(const LMFLmrSubIOV &m) const
Definition: LMFLmrSubIOV.h:68
std::string writeDBSql(Statement *stmt) override
Definition: LMFLmrSubIOV.cc:83
Definition: LMFIOV.h:17
#define noexcept
static const double tmax[3]
std::vector< Tm > getTimes() const
Definition: LMFLmrSubIOV.h:39
oracle::occi::Statement * stmt
std::list< LMFLmrSubIOV > fetchByLMFIOV(const LMFIOV &iov)
Definition: Tm.h:13
std::string fetchIdSql(Statement *stmt) override
Definition: LMFLmrSubIOV.cc:47
int getLMFIOVID() const
Definition: LMFLmrSubIOV.h:28
void getParameters(ResultSet *rset) override
LMFLmrSubIOV & setLMFIOV(const LMFIOV &iov)
Definition: LMFLmrSubIOV.cc:25
~LMFLmrSubIOV() override
Definition: LMFLmrSubIOV.cc:23