ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
SGCore
SGCore
sgkey_t.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4
*/
16
17
18
#ifndef CXXUTILS_SGKEY_T_H
19
#define CXXUTILS_SGKEY_T_H
20
21
22
#include <cstdint>
23
#include <cstddef>
24
#include <unordered_map>
25
#include <unordered_set>
26
27
28
namespace
SG
{
29
30
32
typedef
uint32_t
sgkey_t
;
33
34
38
inline
39
constexpr
bool
sgkeyEqual
(
const
sgkey_t
a
,
const
sgkey_t
b)
40
{
41
return
a
== b;
42
}
43
44
48
inline
49
constexpr
bool
sgkeyLess
(
const
sgkey_t
a
,
const
sgkey_t
b)
50
{
51
return
a
< b;
52
}
53
54
58
struct
SGKeyHash
59
{
60
inline
61
constexpr
size_t
operator()
(
const
sgkey_t
k)
const
62
{
63
return
k;
64
}
65
};
66
67
71
struct
SGKeyEqual
72
{
73
inline
74
constexpr
bool
operator()
(
const
sgkey_t
a
,
const
sgkey_t
b)
const
75
{
76
return
sgkeyEqual
(
a
, b);
77
}
78
};
79
80
84
inline
85
constexpr
uint32_t
sgkeyShort
(
const
sgkey_t
k)
86
{
87
return
k;
88
}
89
90
92
template
<
class
T>
93
using
SGKeyMap
= std::unordered_map<sgkey_t, T>;
94
95
97
using
SGKeySet
= std::unordered_set<sgkey_t>;
98
99
100
}
// namespace SG
101
102
103
#endif
// not CXXUTILS_SGKEY_T_H
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition
sgkey_t.h:32
SG::SGKeySet
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
Definition
sgkey_t.h:97
SG::sgkeyShort
constexpr uint32_t sgkeyShort(const sgkey_t k)
Convert a sgkey to the 32-bit form used for older data.
Definition
sgkey_t.h:85
SG::sgkeyEqual
constexpr bool sgkeyEqual(const sgkey_t a, const sgkey_t b)
Compare two sgkeys for equality.
Definition
sgkey_t.h:39
SG::SGKeyMap
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
Definition
sgkey_t.h:93
SG::sgkeyLess
constexpr bool sgkeyLess(const sgkey_t a, const sgkey_t b)
Compare two sgkeys for ordering.
Definition
sgkey_t.h:49
SG::SGKeyEqual
Comparison functional for sgkey_t.
Definition
sgkey_t.h:72
SG::SGKeyEqual::operator()
constexpr bool operator()(const sgkey_t a, const sgkey_t b) const
Definition
sgkey_t.h:74
SG::SGKeyHash
Hash functional for sgkey_t.
Definition
sgkey_t.h:59
SG::SGKeyHash::operator()
constexpr size_t operator()(const sgkey_t k) const
Definition
sgkey_t.h:61
Generated on
for ATLAS Offline Software by
1.17.0