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-2026 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 <format>
23
#include <iostream>
24
#include <set>
25
26
template
<
typename
T>
27
28
class
IOVEntryT
{
29
public
:
30
31
// Ordered by increasing start times
32
class
IOVEntryTStartCritereon
{
33
public
:
34
bool
operator()
(
const
IOVEntryT<T>
&p1,
const
IOVEntryT<T>
&p2 )
const
{
35
return
p1.range().start() > p2.range().start();
36
}
37
bool
operator()
(
const
IOVEntryT<T>
*p1,
const
IOVEntryT<T>
*p2 )
const
{
38
return
p1->range().start() > p2->range().start();
39
}
40
};
41
42
// Order by decreasing stop times
43
class
IOVEntryTStopCritereon
{
44
public
:
45
bool
operator()
(
const
IOVEntryT<T>
&p1,
const
IOVEntryT<T>
&p2 )
const
{
46
return
p1.range().stop() < p2.range().stop();
47
}
48
bool
operator()
(
const
IOVEntryT<T>
*p1,
const
IOVEntryT<T>
*p2 )
const
{
49
return
p1->range().stop() < p2->range().stop();
50
}
51
};
52
53
IOVEntryT
(){};
54
IOVEntryT
( T *obj,
const
EventIDRange&
range
):
55
m_objPtr
(obj),
m_range
(
range
){}
56
57
~IOVEntryT
() =
default
;
58
59
const
EventIDRange&
range
()
const
{
return
m_range
; }
60
void
setRange
(
const
EventIDRange&
range
) {
m_range
=
range
; }
61
62
T* objPtr
ATLAS_NOT_CONST_THREAD_SAFE
()
const
{
return
m_objPtr
; }
63
void
setPtr
( T* ptr ) {
m_objPtr
= ptr; }
64
65
friend
std::ostream&
operator<<
(std::ostream& os,
const
IOVEntryT<T>
& rhs) {
66
os << rhs.
range
() <<
" "
<< rhs.
m_objPtr
;
67
return
os;
68
}
69
70
private
:
71
T*
m_objPtr
{};
72
EventIDRange
m_range
{};
73
};
74
75
76
namespace
std
{
77
79
template
<
class
T>
80
struct
formatter<
IOVEntryT
<T> >
81
:
public
formatter<string_view>
82
{
83
template
<
class
FmtContext>
84
FmtContext::iterator
format
(
const
IOVEntryT<T>
& io, FmtContext& ctx)
const
85
{
86
std::ostringstream
ss
;
87
ss
<< io;
88
return
formatter<string_view>::format (
ss
.str(), ctx);
89
}
90
};
91
92
}
// namespace std
93
94
95
template
<
typename
T>
96
class
IOVEntryComp
{
97
public
:
98
bool
operator()
(
const
IOVEntryT<T>
&p1,
const
IOVEntryT<T>
&p2 )
const
{
99
return
p1.range().start() > p2.range().start();
100
}
101
};
102
103
// // Order by obj pointer
104
// class IOVEntryTProxyCritereon {
105
// public:
106
// bool operator() ( const IOVEntryT &p1, const IOVEntryT &p2) const {
107
// return p1.proxy() < p2.proxy();
108
// }
109
// bool operator() ( const IOVEntryT *p1, const IOVEntryT *p2) const {
110
// return p1->proxy() < p2->proxy();
111
// }
112
// };
113
114
#endif
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
checker_macros.h
Define macros for attributes used to control the static checker.
IOVEntryComp
Definition
IOVEntryT.h:96
IOVEntryComp::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition
IOVEntryT.h:98
IOVEntryT::IOVEntryTStartCritereon
Definition
IOVEntryT.h:32
IOVEntryT::IOVEntryTStartCritereon::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition
IOVEntryT.h:34
IOVEntryT::IOVEntryTStopCritereon
Definition
IOVEntryT.h:43
IOVEntryT::IOVEntryTStopCritereon::operator()
bool operator()(const IOVEntryT< T > &p1, const IOVEntryT< T > &p2) const
Definition
IOVEntryT.h:45
IOVEntryT
Definition
IOVEntryT.h:28
IOVEntryT::setPtr
void setPtr(T *ptr)
Definition
IOVEntryT.h:63
IOVEntryT::~IOVEntryT
~IOVEntryT()=default
IOVEntryT::ATLAS_NOT_CONST_THREAD_SAFE
T *objPtr ATLAS_NOT_CONST_THREAD_SAFE() const
Definition
IOVEntryT.h:62
IOVEntryT::m_range
EventIDRange m_range
Definition
IOVEntryT.h:72
IOVEntryT::IOVEntryT
IOVEntryT(T *obj, const EventIDRange &range)
Definition
IOVEntryT.h:54
IOVEntryT::m_objPtr
T * m_objPtr
Definition
IOVEntryT.h:71
IOVEntryT::IOVEntryT
IOVEntryT()
Definition
IOVEntryT.h:53
IOVEntryT::range
const EventIDRange & range() const
Definition
IOVEntryT.h:59
IOVEntryT::operator<<
friend std::ostream & operator<<(std::ostream &os, const IOVEntryT< T > &rhs)
Definition
IOVEntryT.h:65
IOVEntryT::setRange
void setRange(const EventIDRange &range)
Definition
IOVEntryT.h:60
std
STL namespace.
std::formatter< IOVEntryT< T > >::format
FmtContext::iterator format(const IOVEntryT< T > &io, FmtContext &ctx) const
Definition
IOVEntryT.h:84
Generated on
for ATLAS Offline Software by
1.17.0