ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
SGTools
src
Control/SGTools/src/exceptions.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
12
#include "
SGTools/exceptions.h
"
13
#include "
SGTools/DataProxy.h
"
14
#include "GaudiKernel/System.h"
15
#include <format>
16
#include <string>
17
18
19
namespace
SG
{
20
21
23
std::string
excBadDataProxyCast_format
(
CLID
id
,
const
std::type_info& tid)
24
{
25
return
std::format (
"ExcBadDataProxyCast: Bad cast of DataProxy with CLID {} to type {}"
,
26
id
, System::typeinfoName (tid));
27
}
28
29
35
ExcBadDataProxyCast::ExcBadDataProxyCast
(
CLID
id
,
const
std::type_info& tid)
36
:
m_what
(
excBadDataProxyCast_format
(id, tid))
37
{
38
}
39
40
44
const
char
*
ExcBadDataProxyCast::what
()
const
noexcept
45
{
46
return
m_what
.c_str();
47
}
48
49
55
void
throwExcBadDataProxyCast
(
const
DataProxy
& proxy,
const
std::type_info& tid)
56
{
57
throw
ExcBadDataProxyCast
(proxy.clID(), tid);
58
}
59
60
61
//*************************************************************************
62
63
65
std::string
excProxyCollision_format
(
CLID
id
,
66
const
std::string& key,
67
CLID
primary_id,
68
const
std::string& primary_key)
69
{
70
return
std::format (
"ExcProxyCollision: proxy collision for clid/key {} / {}"
71
" (primary {} / {})."
,
72
id
, key, primary_id, primary_key);
73
}
74
75
83
ExcProxyCollision::ExcProxyCollision
(
CLID
id
,
84
const
std::string& key,
85
CLID
primary_id,
86
const
std::string& primary_key)
87
:
std
::runtime_error (
excProxyCollision_format
(id,
88
key,
89
primary_id,
90
primary_key))
91
{
92
}
93
94
95
//*************************************************************************
96
97
99
std::string
excSgkeyCollision_format
(
const
std::string& new_key,
100
CLID
new_clid,
101
const
std::string& old_key,
102
CLID
old_clid,
103
sgkey_t
sgkey)
104
{
105
return
std::format (
"ExcSgkeyCollision: sgkey hash collision; "
106
"new key: {}/{} and existing key: {}/{} both hash to {}"
,
107
new_key, new_clid, old_key, old_clid, sgkey);
108
}
109
110
119
ExcSgkeyCollision::ExcSgkeyCollision
(
const
std::string& new_key,
120
CLID
new_clid,
121
const
std::string& old_key,
122
CLID
old_clid,
123
sgkey_t
sgkey)
124
:
std
::runtime_error (
excSgkeyCollision_format
(new_key, new_clid,
125
old_key, old_clid,
126
sgkey))
127
{
128
}
129
130
131
}
// namespace SG
exceptions.h
Exceptions that can be thrown by SGTools.
DataProxy.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::DataProxy
Definition
DataProxy.h:45
SG::ExcBadDataProxyCast
Exception — Bad cast of DataProxy with CLID.
Definition
Control/SGTools/SGTools/exceptions.h:38
SG::ExcBadDataProxyCast::what
virtual const char * what() const noexcept override
Return the message for this exception.
Definition
Control/SGTools/src/exceptions.cxx:44
SG::ExcBadDataProxyCast::m_what
std::string m_what
The message for this exception.
Definition
Control/SGTools/SGTools/exceptions.h:60
SG::ExcBadDataProxyCast::ExcBadDataProxyCast
ExcBadDataProxyCast(CLID id, const std::type_info &tid)
Constructor.
Definition
Control/SGTools/src/exceptions.cxx:35
SG::ExcProxyCollision::ExcProxyCollision
ExcProxyCollision(CLID id, const std::string &key, CLID primary_id, const std::string &primary_key)
Constructor.
Definition
Control/SGTools/src/exceptions.cxx:83
SG::ExcSgkeyCollision::ExcSgkeyCollision
ExcSgkeyCollision(const std::string &new_key, CLID new_clid, const std::string &old_key, CLID old_clid, sgkey_t sgkey)
Constructor.
Definition
Control/SGTools/src/exceptions.cxx:119
const
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::throwExcBadDataProxyCast
void throwExcBadDataProxyCast(const DataProxy &proxy, const std::type_info &tid)
Throw an ExcBadDataProxyCast exception.
Definition
Control/SGTools/src/exceptions.cxx:55
SG::excBadDataProxyCast_format
std::string excBadDataProxyCast_format(CLID id, const std::type_info &tid)
Helper: Format exception string.
Definition
Control/SGTools/src/exceptions.cxx:23
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition
sgkey_t.h:32
SG::excSgkeyCollision_format
std::string excSgkeyCollision_format(const std::string &new_key, CLID new_clid, const std::string &old_key, CLID old_clid, sgkey_t sgkey)
Helper: Format exception string.
Definition
Control/SGTools/src/exceptions.cxx:99
SG::excProxyCollision_format
std::string excProxyCollision_format(CLID id, const std::string &key, CLID primary_id, const std::string &primary_key)
Helper: Format exception string.
Definition
Control/SGTools/src/exceptions.cxx:65
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0