CMS 3D CMS Logo

Typedefs | Functions | Variables

cond::time Namespace Reference

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 Documentation

typedef boost::date_time::subsecond_duration<boost::posix_time::time_duration,1000000000> cond::time::nanoseconds

Definition at line 18 of file TimeConversions.h.


Function Documentation

Time_t cond::time::from_boost ( boost::posix_time::ptime  bt) [inline]

Definition at line 52 of file TimeConversions.h.

References itsNanoseconds(), lumiQTWidget::t, and time0.

Referenced by SiStripDetVOffBuilder::getCondTime(), and FillInfoPopConSourceHandler::getNewObjects().

                                                      {
      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]

Definition at line 70 of file TimeConversions.h.

References lumiQTWidget::t.

Referenced by now().

                                             {
      Time_t t = stv.tv_sec;
      return (t << 32) + 1000*stv.tv_usec;
    }
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  )
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 lumiQTWidget::t.

                                                    {
      Time_t t = iValue.first;
      return (t<< 32) + iValue.second;
    }
boost::posix_time::ptime cond::time::to_boost ( Time_t  iValue) [inline]
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().

Referenced by FillInfoPopConSourceHandler::getNewObjects().

                                                      {
      return cond::UnpackedTime(iValue >> 32, kLowMask & iValue);
    }

Variable Documentation

const boost::posix_time::ptime cond::time::time0
Initial value:
      boost::posix_time::from_time_t(0)

Definition at line 42 of file TimeConversions.h.

Referenced by from_boost(), RunInfoRead::readData(), and to_boost().