ATLAS Offline Software
Loading...
Searching...
No Matches
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
24template <typename T>
25
26class IOVEntryT {
27public:
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
52 IOVEntryT( T *obj, const EventIDRange& range):
53 m_objPtr(obj), m_range(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
68private:
69 T* m_objPtr {};
70 EventIDRange m_range {};
71
72};
73
74template <typename T>
76public:
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
Define macros for attributes used to control the static checker.
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition IOVEntryT.h:77
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition IOVEntryT.h:32
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition IOVEntryT.h:43
void setPtr(T *ptr)
Definition IOVEntryT.h:61
~IOVEntryT()=default
T *objPtr ATLAS_NOT_CONST_THREAD_SAFE() const
Definition IOVEntryT.h:60
EventIDRange m_range
Definition IOVEntryT.h:70
IOVEntryT(T *obj, const EventIDRange &range)
Definition IOVEntryT.h:52
T * m_objPtr
Definition IOVEntryT.h:69
const EventIDRange & range() const
Definition IOVEntryT.h:57
friend std::ostream & operator<<(std::ostream &os, const IOVEntryT< T > &rhs)
Definition IOVEntryT.h:63
void setRange(const EventIDRange &range)
Definition IOVEntryT.h:58