ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaKernel
AthenaKernel
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
20
#include "
CxxUtils/checker_macros.h
"
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
30
class
IOVEntryTStartCritereon
{
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
41
class
IOVEntryTStopCritereon
{
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
):
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
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
checker_macros.h
Define macros for attributes used to control the static checker.
IOVEntryComp
Definition
IOVEntryT.h:75
IOVEntryComp::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition
IOVEntryT.h:77
IOVEntryT::IOVEntryTStartCritereon
Definition
IOVEntryT.h:30
IOVEntryT::IOVEntryTStartCritereon::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition
IOVEntryT.h:32
IOVEntryT::IOVEntryTStopCritereon
Definition
IOVEntryT.h:41
IOVEntryT::IOVEntryTStopCritereon::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition
IOVEntryT.h:43
IOVEntryT
Definition
IOVEntryT.h:26
IOVEntryT::setPtr
void setPtr(T *ptr)
Definition
IOVEntryT.h:61
IOVEntryT::~IOVEntryT
~IOVEntryT()=default
IOVEntryT::ATLAS_NOT_CONST_THREAD_SAFE
T *objPtr ATLAS_NOT_CONST_THREAD_SAFE() const
Definition
IOVEntryT.h:60
IOVEntryT::m_range
EventIDRange m_range
Definition
IOVEntryT.h:70
IOVEntryT::IOVEntryT
IOVEntryT(T *obj, const EventIDRange &range)
Definition
IOVEntryT.h:52
IOVEntryT::m_objPtr
T * m_objPtr
Definition
IOVEntryT.h:69
IOVEntryT::IOVEntryT
IOVEntryT()
Definition
IOVEntryT.h:51
IOVEntryT::range
const EventIDRange & range() const
Definition
IOVEntryT.h:57
IOVEntryT::operator<<
friend std::ostream & operator<<(std::ostream &os, const IOVEntryT< T > &rhs)
Definition
IOVEntryT.h:63
IOVEntryT::setRange
void setRange(const EventIDRange &range)
Definition
IOVEntryT.h:58
Generated on
for ATLAS Offline Software by
1.17.0