CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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();
22 
24  LMFLmrSubIOV& setLMFIOV(int i);
25  LMFLmrSubIOV& setTimes(Tm t1, Tm t2, Tm t3);
26  LMFLmrSubIOV& setTimes(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 {
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)
72  throw(std::runtime_error);
73  std::list<int> getIOVIDsLaterThan(const Tm &tmin, const Tm &tmax)
74  throw(std::runtime_error);
75  std::list<int> getIOVIDsLaterThan(const Tm &t, int howMany)
76  throw(std::runtime_error);
77  std::list<int> getIOVIDsLaterThan(const Tm &t, const Tm &tmax,
78  int howMany)
79  throw(std::runtime_error);
80 
81  // Operators
82  inline bool operator==(const LMFLmrSubIOV &m) const
83  {
84  return ( (m_lmfIOV == m.m_lmfIOV) &&
85  (m_t[0] == m.m_t[0]) &&
86  (m_t[1] == m.m_t[1]) &&
87  (m_t[2] == m.m_t[2]));
88  }
89 
90  inline bool operator!=(const LMFLmrSubIOV &m) const { return !(*this == m); }
91 
92  std::list<LMFLmrSubIOV> fetchByLMFIOV(const LMFIOV &iov);
93 
94  private:
95  int m_lmfIOV;
96  Tm m_t[3];
97 
98  std::string fetchIdSql(Statement *stmt);
99  std::string setByIDSql(Statement *stmt, int id);
100  std::string writeDBSql(Statement *stmt);
101  void getParameters(ResultSet *rset);
102  void init();
103 };
104 
105 #endif
int i
Definition: DBlmapReader.cc:9
void getParameters(ResultSet *rset)
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
std::list< int > getIOVIDsLaterThan(const Tm &t)
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19
std::string setByIDSql(Statement *stmt, int id)
Definition: LMFLmrSubIOV.cc:78
void getTimes(Tm *t) const
Definition: LMFLmrSubIOV.h:49
LMFIOV getLMFIOV() const
Definition: LMFLmrSubIOV.h:32
bool operator!=(const LMFLmrSubIOV &m) const
Definition: LMFLmrSubIOV.h:90
std::string fetchIdSql(Statement *stmt)
Definition: LMFLmrSubIOV.cc:52
void setByID(int id)
Definition: LMFUnique.cc:286
LMFLmrSubIOV & setTimes(Tm t1, Tm t2, Tm t3)
Definition: LMFLmrSubIOV.cc:45
tuple iov
Definition: o2o.py:307
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:82
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:14
mathSSE::Vec4< T > v
tuple conn
Definition: results_mgr.py:53
std::string writeDBSql(Statement *stmt)
Definition: LMFLmrSubIOV.cc:87
int getLMFIOVID() const
Definition: LMFLmrSubIOV.h:29
LMFLmrSubIOV & setLMFIOV(const LMFIOV &iov)
Definition: LMFLmrSubIOV.cc:29