ATLAS Offline Software
IOVEntryT.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAKERNEL_IOVENTRYT_H
6 #define ATHENAKERNEL_IOVENTRYT_H
7 
8 /*****************************************************************************
9  *
10  * IOVEntryT.h
11  * IOVSvc
12  *
13  * Author: Charles Leggett
14  *
15  * Validity range object that manages start and stop times, holding link
16  * to templated object.
17  *
18  *****************************************************************************/
19 
21 #include "GaudiKernel/EventIDRange.h"
22 #include <set>
23 
24 template <typename T>
25 
26 class IOVEntryT {
27 public:
28 
29  // Ordered by increasing start times
31  public:
32  bool operator() ( const IOVEntryT<T> &p1, const IOVEntryT<T> &p2 ) const {
33  return p1.range().start() > p2.range().start();
34  }
35  bool operator() ( const IOVEntryT<T> *p1, const IOVEntryT<T> *p2 ) const {
36  return p1->range().start() > p2->range().start();
37  }
38  };
39 
40  // Order by decreasing stop times
42  public:
43  bool operator() ( const IOVEntryT<T> &p1, const IOVEntryT<T> &p2 ) const {
44  return p1.range().stop() < p2.range().stop();
45  }
46  bool operator() ( const IOVEntryT<T> *p1, const IOVEntryT<T> *p2 ) const {
47  return p1->range().stop() < p2->range().stop();
48  }
49  };
50 
51  IOVEntryT(){};
52  IOVEntryT( T *obj, const EventIDRange& range):
54 
55  ~IOVEntryT() = default;
56 
57  const EventIDRange& range() const { return m_range; }
58  void setRange( const EventIDRange& range) { m_range=range; }
59 
60  T* objPtr ATLAS_NOT_CONST_THREAD_SAFE () const { return m_objPtr; }
61  void setPtr( T* ptr ) { m_objPtr = ptr; }
62 
63  friend std::ostream& operator<< (std::ostream& os, const IOVEntryT<T>& rhs) {
64  os << rhs.range() << " " << rhs.m_objPtr;
65  return os;
66  }
67 
68 private:
69  T* m_objPtr {};
70  EventIDRange m_range {};
71 
72 };
73 
74 template <typename T>
75 class IOVEntryComp {
76 public:
77  bool operator() ( const IOVEntryT<T> &p1, const IOVEntryT<T> &p2 ) const {
78  return p1.range().start() > p2.range().start();
79  }
80 };
81 
82 // // Order by obj pointer
83 // class IOVEntryTProxyCritereon {
84 // public:
85 // bool operator() ( const IOVEntryT &p1, const IOVEntryT &p2) const {
86 // return p1.proxy() < p2.proxy();
87 // }
88 // bool operator() ( const IOVEntryT *p1, const IOVEntryT *p2) const {
89 // return p1->proxy() < p2->proxy();
90 // }
91 // };
92 
93 #endif
IOVEntryT::~IOVEntryT
~IOVEntryT()=default
IOVEntryT::IOVEntryTStartCritereon
Definition: IOVEntryT.h:40
IOVEntryT::m_objPtr
T * m_objPtr
Definition: IOVEntryT.h:79
IOVEntryT
Definition: IOVEntryT.h:26
IOVEntryT::IOVEntryTStartCritereon::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition: IOVEntryT.h:52
IOVEntryT::m_range
EventIDRange m_range
Definition: IOVEntryT.h:80
IOVEntryT::operator<<
friend std::ostream & operator<<(std::ostream &os, const IOVEntryT< T > &rhs)
Definition: IOVEntryT.h:73
IOVEntryT::setPtr
void setPtr(T *ptr)
Definition: IOVEntryT.h:71
IOVEntryComp::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition: IOVEntryT.h:77
IOVEntryT::IOVEntryT
IOVEntryT()
Definition: IOVEntryT.h:61
IOVEntryT::setRange
void setRange(const EventIDRange &range)
Definition: IOVEntryT.h:68
IOVEntryComp
Definition: IOVEntryT.h:75
IOVEntryT::IOVEntryTStopCritereon
Definition: IOVEntryT.h:51
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
IOVEntryT::range
const EventIDRange & range() const
Definition: IOVEntryT.h:67
IOVEntryT::IOVEntryTStopCritereon::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition: IOVEntryT.h:53
IOVEntryT::ATLAS_NOT_CONST_THREAD_SAFE
T *objPtr ATLAS_NOT_CONST_THREAD_SAFE() const
Definition: IOVEntryT.h:70
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:135
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35