CMS 3D CMS Logo

DateHandler.h
Go to the documentation of this file.
1 #ifndef DATEHANDLER_H
2 #define DATEHANDLER_H
3 
6 
7 
8 class DateHandler {
9  public:
10 
11  DateHandler(oracle::occi::Environment* env, oracle::occi::Connection* conn);
12  ~DateHandler();
13 
14  inline Tm getNegInfTm() const { return NEG_INF; }
15  inline Tm getPlusInfTm() const { return PLUS_INF; }
16  inline oracle::occi::Date getNegInfDate() const { return NEG_INF_DATE; }
17  inline oracle::occi::Date getPlusInfDate() const { return PLUS_INF_DATE; }
18 
22  inline oracle::occi::Date getCurrentDate()
23  {
24  return oracle::occi::Date(oracle::occi::Date::getSystemDate(m_env));
25  }
26 
30  inline oracle::occi::Date minDate()
31  {
32  return oracle::occi::Date(m_env, 1970, 1, 1, 0, 0, 0);
33  }
34 
38  inline oracle::occi::Date maxDate()
39  {
40  return oracle::occi::Date(m_env, 9999, 12, 31, 23, 59, 59);
41  }
42 
46  oracle::occi::Date tmToDate(const Tm& inTm) const;
47 
51  Tm dateToTm(oracle::occi::Date& date) const;
52 
53  private:
54  DateHandler() = delete; // hide the default constructor
55  oracle::occi::Connection* m_conn;
56  oracle::occi::Environment* m_env;
57 
60  oracle::occi::Date PLUS_INF_DATE;
61  oracle::occi::Date NEG_INF_DATE;
62 };
63 
64 #endif
oracle::occi::Date maxDate()
Definition: DateHandler.h:38
Tm getNegInfTm() const
Definition: DateHandler.h:14
oracle::occi::Date minDate()
Definition: DateHandler.h:30
oracle::occi::Date getPlusInfDate() const
Definition: DateHandler.h:17
oracle::occi::Date getCurrentDate()
Definition: DateHandler.h:22
oracle::occi::Date NEG_INF_DATE
Definition: DateHandler.h:61
oracle::occi::Environment * m_env
Definition: DateHandler.h:56
oracle::occi::Date tmToDate(const Tm &inTm) const
Definition: DateHandler.cc:20
Tm getPlusInfTm() const
Definition: DateHandler.h:15
DateHandler()=delete
oracle::occi::Date PLUS_INF_DATE
Definition: DateHandler.h:60
oracle::occi::Date getNegInfDate() const
Definition: DateHandler.h:16
Tm dateToTm(oracle::occi::Date &date) const
Definition: DateHandler.cc:31
Definition: Tm.h:13
oracle::occi::Connection * m_conn
Definition: DateHandler.h:55