Typedefs | |
typedef boost::date_time::subsecond_duration < boost::posix_time::time_duration, 1000000000 > | nanoseconds |
Functions | |
Time_t | from_boost (boost::posix_time::ptime bt) |
Time_t | from_timeval (::timeval stv) |
unsigned int | itsNanoseconds (boost::posix_time::time_duration const &td) |
const Time_t | kLowMask (0xFFFFFFFF) |
Time_t | now () |
cond::Time_t | pack (cond::UnpackedTime iValue) |
boost::posix_time::ptime | to_boost (Time_t iValue) |
inline::timeval | to_timeval (Time_t iValue) |
cond::UnpackedTime | unpack (cond::Time_t iValue) |
Variables | |
const boost::posix_time::ptime | time0 |
typedef boost::date_time::subsecond_duration<boost::posix_time::time_duration,1000000000> cond::time::nanoseconds |
Definition at line 18 of file TimeConversions.h.
Time_t cond::time::from_boost | ( | boost::posix_time::ptime | bt | ) | [inline] |
Definition at line 52 of file TimeConversions.h.
References itsNanoseconds(), matplotRender::t, and time0.
Referenced by SiStripDetVOffBuilder::getCondTime().
{ boost::posix_time::time_duration td = bt - time0; Time_t t = td.total_seconds(); return (t << 32) + itsNanoseconds(td); }
Time_t cond::time::from_timeval | ( | ::timeval | stv | ) | [inline] |
unsigned int cond::time::itsNanoseconds | ( | boost::posix_time::time_duration const & | td | ) | [inline] |
Definition at line 36 of file TimeConversions.h.
Referenced by from_boost().
{
return boost::posix_time::time_duration::num_fractional_digits() == 6 ?
1000*td.fractional_seconds() : td.fractional_seconds();
}
const Time_t cond::time::kLowMask | ( | 0xFFFFFFFF | ) |
Referenced by ME::time_low(), to_boost(), to_timeval(), and unpack().
Time_t cond::time::now | ( | ) | [inline] |
Definition at line 75 of file TimeConversions.h.
References from_timeval().
{ ::timeval stv; ::gettimeofday(&stv,0); return from_timeval(stv); }
cond::Time_t cond::time::pack | ( | cond::UnpackedTime | iValue | ) | [inline] |
Definition at line 29 of file TimeConversions.h.
References matplotRender::t.
boost::posix_time::ptime cond::time::to_boost | ( | Time_t | iValue | ) | [inline] |
Definition at line 45 of file TimeConversions.h.
References kLowMask(), seconds(), and time0.
Referenced by SiStripDetVOffBuilder::getCoralTime(), and popcon::SiStripDetVOffHandler::setUserTextLog().
{ return time0 + boost::posix_time::seconds( iValue >> 32) + nanoseconds(kLowMask & iValue); }
inline ::timeval cond::time::to_timeval | ( | Time_t | iValue | ) |
Definition at line 60 of file TimeConversions.h.
References kLowMask().
{ ::timeval stv; // stv.tv_sec = static_cast<unsigned int>(iValue >> 32); //stv.tv_usec = static_cast<unsigned int>(kLowMask & iValue); stv.tv_sec = iValue >> 32; stv.tv_usec = (kLowMask & iValue)/1000; return stv; }
cond::UnpackedTime cond::time::unpack | ( | cond::Time_t | iValue | ) | [inline] |
Definition at line 25 of file TimeConversions.h.
References kLowMask().
{ return cond::UnpackedTime(iValue >> 32, kLowMask & iValue); }
const boost::posix_time::ptime cond::time::time0 |
boost::posix_time::from_time_t(0)
Definition at line 42 of file TimeConversions.h.
Referenced by from_boost(), RunInfoRead::readData(), and to_boost().