CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/OnlineDB/EcalCondDB/interface/DateHandler.h

Go to the documentation of this file.
00001 #ifndef DATEHANDLER_H
00002 #define DATEHANDLER_H
00003 
00004 #include "OnlineDB/Oracle/interface/Oracle.h"
00005 #include "OnlineDB/EcalCondDB/interface/Tm.h"
00006 
00007 
00008 class DateHandler {
00009  public:
00010 
00011   DateHandler(oracle::occi::Environment* env, oracle::occi::Connection* conn);
00012   ~DateHandler();
00013   
00014   inline Tm getNegInfTm() const { return NEG_INF; }
00015   inline Tm getPlusInfTm() const { return PLUS_INF; }
00016   inline oracle::occi::Date getNegInfDate() const { return NEG_INF_DATE; }
00017   inline oracle::occi::Date getPlusInfDate() const { return PLUS_INF_DATE; }
00018 
00022   inline oracle::occi::Date getCurrentDate()
00023     {
00024       return oracle::occi::Date(oracle::occi::Date::getSystemDate(m_env));
00025     }
00026 
00030   inline oracle::occi::Date minDate()
00031     { 
00032       return oracle::occi::Date(m_env, 1970, 1, 1, 0, 0, 0); 
00033     }
00034   
00038   inline oracle::occi::Date maxDate()
00039     {
00040       return oracle::occi::Date(m_env, 9999, 12, 31, 23, 59, 59);
00041     }
00042 
00046   oracle::occi::Date tmToDate(const Tm& inTm) const;
00047   
00051   Tm dateToTm(oracle::occi::Date& date) const;
00052   
00053  private:
00054   DateHandler();  // hide the default constructor
00055   oracle::occi::Connection* m_conn;
00056   oracle::occi::Environment* m_env;
00057 
00058   Tm PLUS_INF;
00059   Tm NEG_INF;
00060   oracle::occi::Date PLUS_INF_DATE;
00061   oracle::occi::Date NEG_INF_DATE;
00062 };
00063 
00064 #endif