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 36 of file IOVProxy.cc.

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

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

36  {
37  if (ii>=(int)v.iovs().size() || ii<0) {
39  return;
40  }
41  size_t i =ii;
42  m_token = v.iovs()[i].token();
43  m_since = v.iovs()[i].sinceTime();
44  if(i+1==v.iovs().size()) {
45  m_till = v.lastTill();
46  return;
47  }
48  cond::UnpackedTime unpackedTime;
49  cond::Time_t totalNanoseconds;
50  cond::Time_t totalSecondsInNanoseconds;
51  switch (v.timeType()) {
52  case timestamp:
53  //unpacking
54  unpackedTime = cond::time::unpack(v.iovs()[i+1].sinceTime());
55  //number of seconds in nanoseconds (avoid multiply and divide by 1e09)
56  totalSecondsInNanoseconds = ((cond::Time_t)unpackedTime.first)*1000000000;
57  //total number of nanoseconds
58  totalNanoseconds = totalSecondsInNanoseconds + ((cond::Time_t)(unpackedTime.second));
59  //now decrementing of 1 nanosecond
60  totalNanoseconds--;
61  //now repacking (just change the value of the previous pair)
62  unpackedTime.first = (unsigned int) (totalNanoseconds/1000000000);
63  unpackedTime.second = (unsigned int)(totalNanoseconds - (cond::Time_t)unpackedTime.first*1000000000);
64  m_till = cond::time::pack(unpackedTime);
65  break;
66  default:
67  m_till = v.iovs()[i+1].sinceTime()-1;
68  }
69 }
int i
Definition: DBlmapReader.cc:9
cond::Time_t m_since
Definition: IOVProxy.h:80
cond::Time_t pack(cond::UnpackedTime iValue)
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
mathSSE::Vec4< T > v
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().