ATLAS Offline Software
IOVRange.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAKERNEL_IOVRANGE_H
6 #define ATHENAKERNEL_IOVRANGE_H
7 
19 #include "AthenaKernel/IOVTime.h"
20 #include <string>
21 #include <iosfwd>
22 
23 class MsgStream;
24 class EventIDRange;
25 
30 class IOVRange {
31 public:
32  IOVRange(): m_start(0),m_stop(0) {};
33  IOVRange( const IOVTime& start, const IOVTime& stop );
34  IOVRange( const EventIDRange& eir);
35  IOVRange( const IOVRange& r ) = default;
36  IOVRange& operator= (const IOVRange& r) = default;
37 
38  const IOVTime& start() const { return m_start; }
39  const IOVTime& stop() const { return m_stop; }
40 
41  bool isInRange(const IOVTime& t) const {
42  return ( t>=m_start && t<m_stop );
43  }
44 
45  friend bool operator==(const IOVRange& lhs, const IOVRange& rhs);
46  friend bool operator!=(const IOVRange& lhs, const IOVRange& rhs);
47 
48  friend std::ostream& operator<<(std::ostream& os, const IOVRange& rhs);
49  friend MsgStream& operator<<(MsgStream& os, const IOVRange& rhs);
50 
51  operator std::string() const;
52  operator EventIDRange() const;
53 
54 private:
55 
58 
59 };
60 
61 
62 inline bool operator==(const IOVRange& lhs, const IOVRange& rhs) {
63  return lhs.m_start==rhs.m_start &&
64  lhs.m_stop==rhs.m_stop ;
65 }
66 
67 inline bool operator!=(const IOVRange& lhs, const IOVRange& rhs) {
68  return ! (lhs == rhs);
69 }
70 
71 
72 #endif
IOVRange::operator=
IOVRange & operator=(const IOVRange &r)=default
beamspotman.r
def r
Definition: beamspotman.py:676
IOVRange::operator<<
friend std::ostream & operator<<(std::ostream &os, const IOVRange &rhs)
Definition: IOVRange.cxx:47
IOVRange
Validity Range object. Holds two IOVTimes (start and stop)
Definition: IOVRange.h:30
IOVRange::start
const IOVTime & start() const
Definition: IOVRange.h:38
IOVRange::isInRange
bool isInRange(const IOVTime &t) const
Definition: IOVRange.h:41
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
IOVTime.h
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
IOVRange::stop
const IOVTime & stop() const
Definition: IOVRange.h:39
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
operator==
bool operator==(const IOVRange &lhs, const IOVRange &rhs)
Definition: IOVRange.h:62
IOVRange::IOVRange
IOVRange(const IOVRange &r)=default
IOVRange::operator!=
friend bool operator!=(const IOVRange &lhs, const IOVRange &rhs)
Definition: IOVRange.h:67
IOVRange::m_stop
IOVTime m_stop
Definition: IOVRange.h:57
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
IOVRange::IOVRange
IOVRange()
Definition: IOVRange.h:32
IOVRange::operator==
friend bool operator==(const IOVRange &lhs, const IOVRange &rhs)
Definition: IOVRange.h:62
operator!=
bool operator!=(const IOVRange &lhs, const IOVRange &rhs)
Definition: IOVRange.h:67
IOVRange::m_start
IOVTime m_start
Definition: IOVRange.h:56