CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cond::IOVElementProxy Class Reference

#include <IOVProxy.h>

Public Member Functions

 IOVElementProxy ()
 
 IOVElementProxy (cond::Time_t is, cond::Time_t it, std::string const &itoken)
 
void set (cond::Time_t is, cond::Time_t it, std::string const &itoken)
 
void set (IOVSequence const &v, int i)
 
cond::Time_t since () const
 
cond::Time_t till () const
 
std::string const & token () const
 

Private Attributes

cond::Time_t m_since
 
cond::Time_t m_till
 
std::string m_token
 

Detailed Description

Definition at line 47 of file IOVProxy.h.

Constructor & Destructor Documentation

cond::IOVElementProxy::IOVElementProxy ( )
inline

Definition at line 49 of file IOVProxy.h.

49  :
52  m_token("") {}
cond::Time_t m_since
Definition: IOVProxy.h:80
cond::Time_t m_till
Definition: IOVProxy.h:81
std::string m_token
Definition: IOVProxy.h:82
const Time_t invalidTime(0)
cond::IOVElementProxy::IOVElementProxy ( cond::Time_t  is,
cond::Time_t  it,
std::string const &  itoken 
)
inline

Definition at line 54 of file IOVProxy.h.

54  :
55  m_since(is),
56  m_till(it),
57  m_token(itoken) {}
cond::Time_t m_since
Definition: IOVProxy.h:80
cond::Time_t m_till
Definition: IOVProxy.h:81
std::string m_token
Definition: IOVProxy.h:82

Member Function Documentation

void cond::IOVElementProxy::set ( cond::Time_t  is,
cond::Time_t  it,
std::string const &  itoken 
)
inline

Definition at line 59 of file IOVProxy.h.

References m_since, m_till, and m_token.

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), cond::BasePayloadProxy::loadFor(), cond::BasePayloadProxy::make(), and cond::IterHelp::operator()().

59  {
60  m_since=is;
61  m_till=it;
62  m_token=itoken;
63  }
cond::Time_t m_since
Definition: IOVProxy.h:80
cond::Time_t m_till
Definition: IOVProxy.h:81
std::string m_token
Definition: IOVProxy.h:82
void cond::IOVElementProxy::set ( IOVSequence const &  v,
int  i 
)

Definition at line 39 of file IOVProxy.cc.

References i, cuy::ii, cond::invalidTime(), cond::IOVSequence::iovs(), cond::IOVSequence::lastTill(), cond::time::pack(), ora::QueryableVector< Tp >::size(), cond::timestamp, cond::IOVSequence::timeType(), and cond::time::unpack().

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

39  {
40  if (ii>=(int)v.iovs().size() || ii<0) {
42  return;
43  }
44  size_t i =ii;
45  m_token = v.iovs()[i].token();
46  m_since = v.iovs()[i].sinceTime();
47  if(i+1==v.iovs().size()) {
48  m_till = v.lastTill();
49  return;
50  }
51  cond::UnpackedTime unpackedTime;
52  cond::Time_t totalNanoseconds;
53  cond::Time_t totalSecondsInNanoseconds;
54  switch (v.timeType()) {
55  case timestamp:
56  //unpacking
57  unpackedTime = cond::time::unpack(v.iovs()[i+1].sinceTime());
58  //number of seconds in nanoseconds (avoid multiply and divide by 1e09)
59  totalSecondsInNanoseconds = ((cond::Time_t)unpackedTime.first)*1000000000;
60  //total number of nanoseconds
61  totalNanoseconds = totalSecondsInNanoseconds + ((cond::Time_t)(unpackedTime.second));
62  //now decrementing of 1 nanosecond
63  totalNanoseconds--;
64  //now repacking (just change the value of the previous pair)
65  unpackedTime.first = (unsigned int) (totalNanoseconds/1000000000);
66  unpackedTime.second = (unsigned int)(totalNanoseconds - (cond::Time_t)unpackedTime.first*1000000000);
67  m_till = cond::time::pack(unpackedTime);
68  break;
69  default:
70  m_till = v.iovs()[i+1].sinceTime()-1;
71  }
72 }
int i
Definition: DBlmapReader.cc:9
cond::Time_t m_since
Definition: IOVProxy.h:80
cond::Time_t pack(cond::UnpackedTime iValue)
int ii
Definition: cuy.py:588
cond::Time_t m_till
Definition: IOVProxy.h:81
unsigned long long Time_t
Definition: Time.h:16
void set(cond::Time_t is, cond::Time_t it, std::string const &itoken)
Definition: IOVProxy.h:59
std::string m_token
Definition: IOVProxy.h:82
const Time_t invalidTime(0)
std::pair< unsigned int, unsigned int > UnpackedTime
Definition: Time.h:17
cond::UnpackedTime unpack(cond::Time_t iValue)
cond::Time_t cond::IOVElementProxy::since ( ) const
inline
cond::Time_t cond::IOVElementProxy::till ( ) const
inline
std::string const& cond::IOVElementProxy::token ( ) const
inline

Member Data Documentation

cond::Time_t cond::IOVElementProxy::m_since
private

Definition at line 80 of file IOVProxy.h.

Referenced by set(), and since().

cond::Time_t cond::IOVElementProxy::m_till
private

Definition at line 81 of file IOVProxy.h.

Referenced by set(), and till().

std::string cond::IOVElementProxy::m_token
private

Definition at line 82 of file IOVProxy.h.

Referenced by set(), and token().