CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
TimeValidityInterval Struct Reference

Validity interval in timestamps. More...

#include <RPAlignmentCorrectionsDataSequence.h>

Public Member Functions

bool operator< (const TimeValidityInterval &o) const
 
void SetInfinite ()
 
 TimeValidityInterval (edm::TimeValue_t _f=0, edm::TimeValue_t _l=0)
 

Static Public Member Functions

static const edm::TimeValue_t BeginOfTime ()
 
static const edm::TimeValue_t EndOfTime ()
 
static edm::TimeValue_t UNIXStringToValue (const std::string &s)
 
static std::string ValueToUNIXString (const edm::TimeValue_t &v)
 

Public Attributes

edm::TimeValue_t first
 the boundaries (included) of the interval expressed as UNIX timestamps More...
 
edm::TimeValue_t last
 

Detailed Description

Validity interval in timestamps.

Definition at line 23 of file RPAlignmentCorrectionsDataSequence.h.

Constructor & Destructor Documentation

TimeValidityInterval::TimeValidityInterval ( edm::TimeValue_t  _f = 0,
edm::TimeValue_t  _l = 0 
)
inline

Definition at line 28 of file RPAlignmentCorrectionsDataSequence.h.

Referenced by RPAlignmentCorrectionsDataSequence::Insert().

28 : first(_f), last(_l) {}
edm::TimeValue_t first
the boundaries (included) of the interval expressed as UNIX timestamps

Member Function Documentation

static const edm::TimeValue_t TimeValidityInterval::BeginOfTime ( )
inlinestatic

Definition at line 30 of file RPAlignmentCorrectionsDataSequence.h.

References edm::Timestamp::beginOfTime(), and edm::Timestamp::value().

Referenced by SetInfinite(), UNIXStringToValue(), and ValueToUNIXString().

31  {
33  }
static Timestamp beginOfTime()
Definition: Timestamp.h:103
TimeValue_t value() const
Definition: Timestamp.h:56
static const edm::TimeValue_t TimeValidityInterval::EndOfTime ( )
inlinestatic
bool TimeValidityInterval::operator< ( const TimeValidityInterval o) const
inline

Definition at line 73 of file RPAlignmentCorrectionsDataSequence.h.

References first, and last.

74  {
75  if (first < o.first)
76  return true;
77  if (first > o.first)
78  return false;
79  if (last < o.last)
80  return true;
81  return false;
82  }
edm::TimeValue_t first
the boundaries (included) of the interval expressed as UNIX timestamps
void TimeValidityInterval::SetInfinite ( )
inline

Definition at line 40 of file RPAlignmentCorrectionsDataSequence.h.

References BeginOfTime(), and EndOfTime().

Referenced by RPAlignmentCorrectionsDataSequence::LoadXMLFile().

41  {
42  first = BeginOfTime();
43  last = EndOfTime();
44  }
static const edm::TimeValue_t BeginOfTime()
edm::TimeValue_t first
the boundaries (included) of the interval expressed as UNIX timestamps
static const edm::TimeValue_t EndOfTime()
static edm::TimeValue_t TimeValidityInterval::UNIXStringToValue ( const std::string &  s)
inlinestatic

Definition at line 60 of file RPAlignmentCorrectionsDataSequence.h.

References BeginOfTime(), EndOfTime(), and findQualityFiles::v.

Referenced by RPAlignmentCorrectionsDataSequence::LoadXMLFile().

61  {
62  if (s.compare("-inf") == 0)
63  return BeginOfTime();
64 
65  if (s.compare("+inf") == 0)
66  return EndOfTime();
67 
68  // see: src/framework/DataFormats/Provenance/interface/Timestamp.h
69  edm::TimeValue_t v = atoi(s.c_str());
70  return v << 32;
71  }
unsigned long long TimeValue_t
Definition: Timestamp.h:28
static const edm::TimeValue_t BeginOfTime()
static const edm::TimeValue_t EndOfTime()
static std::string TimeValidityInterval::ValueToUNIXString ( const edm::TimeValue_t v)
inlinestatic

Definition at line 46 of file RPAlignmentCorrectionsDataSequence.h.

References BeginOfTime(), and EndOfTime().

Referenced by TotemRPIncludeAlignments::Merge(), TotemRPIncludeAlignments::setIntervalFor(), and RPAlignmentCorrectionsDataSequence::WriteXMLFile().

47  {
48  if (v == BeginOfTime())
49  return "-inf";
50 
51  if (v == EndOfTime())
52  return "+inf";
53 
54  // see: src/framework/DataFormats/Provenance/interface/Timestamp.h
55  char buf[50];
56  sprintf(buf, "%llu", v >> 32);
57  return buf;
58  }
static const edm::TimeValue_t BeginOfTime()
static const edm::TimeValue_t EndOfTime()

Member Data Documentation

edm::TimeValue_t TimeValidityInterval::first

the boundaries (included) of the interval expressed as UNIX timestamps

Definition at line 26 of file RPAlignmentCorrectionsDataSequence.h.

Referenced by TotemRPIncludeAlignments::Merge(), and operator<().

edm::TimeValue_t TimeValidityInterval::last