CMS 3D CMS Logo

DateHandler.h
Go to the documentation of this file.
1 #ifndef DATEHANDLER_H
2 #define DATEHANDLER_H
3 
6 
7 class DateHandler {
8 public:
9  DateHandler(oracle::occi::Environment* env, oracle::occi::Connection* conn);
10  ~DateHandler();
11 
12  inline Tm getNegInfTm() const { return NEG_INF; }
13  inline Tm getPlusInfTm() const { return PLUS_INF; }
14  inline oracle::occi::Date getNegInfDate() const { return NEG_INF_DATE; }
15  inline oracle::occi::Date getPlusInfDate() const { return PLUS_INF_DATE; }
16 
20  inline oracle::occi::Date getCurrentDate() { return oracle::occi::Date(oracle::occi::Date::getSystemDate(m_env)); }
21 
25  inline oracle::occi::Date minDate() { return oracle::occi::Date(m_env, 1970, 1, 1, 0, 0, 0); }
26 
30  inline oracle::occi::Date maxDate() { return oracle::occi::Date(m_env, 9999, 12, 31, 23, 59, 59); }
31 
35  oracle::occi::Date tmToDate(const Tm& inTm) const;
36 
40  Tm dateToTm(oracle::occi::Date& date) const;
41 
42 private:
43  DateHandler() = delete; // hide the default constructor
44  oracle::occi::Connection* m_conn;
45  oracle::occi::Environment* m_env;
46 
49  oracle::occi::Date PLUS_INF_DATE;
50  oracle::occi::Date NEG_INF_DATE;
51 };
52 
53 #endif
oracle::occi::Date maxDate()
Definition: DateHandler.h:30
Tm getNegInfTm() const
Definition: DateHandler.h:12
oracle::occi::Date minDate()
Definition: DateHandler.h:25
oracle::occi::Date getPlusInfDate() const
Definition: DateHandler.h:15
oracle::occi::Date getCurrentDate()
Definition: DateHandler.h:20
oracle::occi::Date NEG_INF_DATE
Definition: DateHandler.h:50
oracle::occi::Environment * m_env
Definition: DateHandler.h:45
oracle::occi::Date tmToDate(const Tm &inTm) const
Definition: DateHandler.cc:19
Tm getPlusInfTm() const
Definition: DateHandler.h:13
DateHandler()=delete
oracle::occi::Date PLUS_INF_DATE
Definition: DateHandler.h:49
oracle::occi::Date getNegInfDate() const
Definition: DateHandler.h:14
Tm dateToTm(oracle::occi::Date &date) const
Definition: DateHandler.cc:28
Definition: Tm.h:13
oracle::occi::Connection * m_conn
Definition: DateHandler.h:44