#include <DateHandler.h>
Public Member Functions | |
DateHandler (oracle::occi::Environment *env, oracle::occi::Connection *conn) | |
Tm | dateToTm (oracle::occi::Date &date) const |
oracle::occi::Date | getCurrentDate () |
oracle::occi::Date | getNegInfDate () const |
Tm | getNegInfTm () const |
oracle::occi::Date | getPlusInfDate () const |
Tm | getPlusInfTm () const |
oracle::occi::Date | maxDate () |
oracle::occi::Date | minDate () |
oracle::occi::Date | tmToDate (const Tm &inTm) const |
~DateHandler () | |
Private Member Functions | |
DateHandler () | |
Private Attributes | |
oracle::occi::Connection * | m_conn |
oracle::occi::Environment * | m_env |
Tm | NEG_INF |
oracle::occi::Date | NEG_INF_DATE |
Tm | PLUS_INF |
oracle::occi::Date | PLUS_INF_DATE |
Definition at line 8 of file DateHandler.h.
DateHandler::DateHandler | ( | oracle::occi::Environment * | env, |
oracle::occi::Connection * | conn | ||
) |
DateHandler::~DateHandler | ( | ) |
Definition at line 18 of file DateHandler.cc.
{}
DateHandler::DateHandler | ( | ) | [private] |
Tm DateHandler::dateToTm | ( | oracle::occi::Date & | date | ) | const |
Translate an oracle Date object to a Tm object
Definition at line 31 of file DateHandler.cc.
References min, and LaserDQM_cfi::mon.
Referenced by ODCond2ConfInfo::fetchData(), FEConfigMainInfo::fetchData(), ODRunConfigInfo::fetchData(), FEConfigTimingInfo::fetchData(), FEConfigLUTInfo::fetchData(), FEConfigLinInfo::fetchData(), FEConfigPedInfo::fetchData(), FEConfigSlidingInfo::fetchData(), FEConfigWeightInfo::fetchData(), FEConfigFgrInfo::fetchData(), FEConfigSpikeInfo::fetchData(), RunList::fetchGlobalRunsByLocation(), FEConfigSpikeInfo::fetchLastData(), FEConfigWeightInfo::fetchLastData(), FEConfigSlidingInfo::fetchLastData(), FEConfigFgrInfo::fetchLastData(), FEConfigTimingInfo::fetchLastData(), FEConfigLUTInfo::fetchLastData(), FEConfigPedInfo::fetchLastData(), FEConfigLinInfo::fetchLastData(), MonRunList::fetchLastNRuns(), RunList::fetchLastNRuns(), MonRunList::fetchRuns(), RunList::fetchRuns(), RunList::fetchRunsByLocation(), DCSPTMTempList::fetchValuesForECID(), DCSPTMTempList::fetchValuesForECIDAndTime(), RunDCSMagnetDat::fillTheMap(), LMFCorrCoefDat::getCorrections(), LMFIOV::getParameters(), LMFSeqDat::getParameters(), LMFRunIOV::getParameters(), FEConfigPedInfo::setByID(), FEConfigLUTInfo::setByID(), RunIOV::setByID(), FEConfigSlidingInfo::setByID(), MonRunIOV::setByID(), FEConfigTimingInfo::setByID(), ODRunConfigInfo::setByID(), FEConfigLinInfo::setByID(), FEConfigMainInfo::setByID(), MODRunIOV::setByID(), FEConfigWeightInfo::setByID(), FEConfigSpikeInfo::setByID(), CaliIOV::setByID(), DCUIOV::setByID(), FEConfigFgrInfo::setByID(), RunIOV::setByRecentData(), MODRunIOV::setByRun(), RunIOV::setByRun(), MonRunIOV::setByRun(), CaliIOV::setByTm(), and DCUIOV::setByTm().
{ if (date.isNull()) { return Tm(); } int year; unsigned int mon; // month unsigned int mday; // day of month unsigned int hour; unsigned int min; // minute unsigned int sec; // second date.getDate(year, mon, mday, hour, min, sec); // work on the provided tm struct tm retTm; retTm.tm_year = year - 1900; retTm.tm_mon = mon - 1; retTm.tm_mday = mday; retTm.tm_hour = hour; retTm.tm_min = min; retTm.tm_sec = sec; retTm.tm_isdst = 0; retTm.tm_wday = 0; retTm.tm_yday = 0; mktime(&retTm); // calculates tm_wday and tm_yday return Tm(&retTm); }
oracle::occi::Date DateHandler::getCurrentDate | ( | ) | [inline] |
Get the current system date
Definition at line 22 of file DateHandler.h.
References m_env.
{ return oracle::occi::Date(oracle::occi::Date::getSystemDate(m_env)); }
oracle::occi::Date DateHandler::getNegInfDate | ( | ) | const [inline] |
Tm DateHandler::getNegInfTm | ( | ) | const [inline] |
oracle::occi::Date DateHandler::getPlusInfDate | ( | ) | const [inline] |
Tm DateHandler::getPlusInfTm | ( | ) | const [inline] |
Definition at line 15 of file DateHandler.h.
References PLUS_INF.
Referenced by RunIOV::fetchID(), CaliIOV::fetchID(), MODRunIOV::fetchID(), MonRunIOV::fetchID(), DCUIOV::fetchID(), RunIOV::fetchIDByRunAndTag(), RunIOV::updateEndTimeDB(), RunIOV::updateStartTimeDB(), DCUIOV::writeDB(), RunIOV::writeDB(), CaliIOV::writeDB(), MODRunIOV::writeDB(), MonRunIOV::writeDB(), LMFLmrSubIOV::writeDBSql(), and LMFSeqDat::writeDBSql().
{ return PLUS_INF; }
oracle::occi::Date DateHandler::maxDate | ( | ) | [inline] |
The maximum oracle Date
Definition at line 38 of file DateHandler.h.
References m_env.
{ return oracle::occi::Date(m_env, 9999, 12, 31, 23, 59, 59); }
oracle::occi::Date DateHandler::minDate | ( | ) | [inline] |
The minimum oracle Date
Definition at line 30 of file DateHandler.h.
References m_env.
{ return oracle::occi::Date(m_env, 1970, 1, 1, 0, 0, 0); }
Date DateHandler::tmToDate | ( | const Tm & | inTm | ) | const |
Translate a Tm object to a oracle Date object
Definition at line 20 of file DateHandler.cc.
References Tm::c_tm(), and Tm::isNull().
Referenced by RunIOV::fetchID(), CaliIOV::fetchID(), MODRunIOV::fetchID(), MonRunIOV::fetchID(), DCUIOV::fetchID(), LMFIOV::fetchIdSql(), LMFLmrSubIOV::fetchIdSql(), DCSPTMTempList::fetchValuesForECIDAndTime(), RunDCSHVDat::getBarrelRset(), RunDCSHVDat::getEndcapAnodeRset(), RunDCSHVDat::getEndcapDynodeRset(), LMFLmrSubIOV::getIOVIDsLaterThan(), CaliIOV::setByTm(), DCUIOV::setByTm(), RunIOV::updateEndTimeDB(), RunIOV::updateStartTimeDB(), DCUIOV::writeDB(), RunIOV::writeDB(), CaliIOV::writeDB(), MODRunIOV::writeDB(), ODCond2ConfInfo::writeDB(), MonRunIOV::writeDB(), LMFIOV::writeDBSql(), LMFLmrSubIOV::writeDBSql(), LMFRunIOV::writeDBSql(), and LMFSeqDat::writeDBSql().
oracle::occi::Connection* DateHandler::m_conn [private] |
Definition at line 55 of file DateHandler.h.
oracle::occi::Environment* DateHandler::m_env [private] |
Definition at line 56 of file DateHandler.h.
Referenced by getCurrentDate(), maxDate(), and minDate().
Tm DateHandler::NEG_INF [private] |
Definition at line 59 of file DateHandler.h.
Referenced by getNegInfTm().
oracle::occi::Date DateHandler::NEG_INF_DATE [private] |
Definition at line 61 of file DateHandler.h.
Referenced by getNegInfDate().
Tm DateHandler::PLUS_INF [private] |
Definition at line 58 of file DateHandler.h.
Referenced by getPlusInfTm().
oracle::occi::Date DateHandler::PLUS_INF_DATE [private] |
Definition at line 60 of file DateHandler.h.
Referenced by getPlusInfDate().