ATLAS Offline Software
Control/SGTools/SGTools/exceptions.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 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
14 #ifndef SGTOOLS_EXCEPTIONS_H
15 #define SGTOOLS_EXCEPTIONS_H
16 
17 
18 #include "CxxUtils/sgkey_t.h"
19 #include "GaudiKernel/ClassID.h"
20 #include <typeinfo>
21 #include <stdexcept>
22 #include <string>
23 
24 
25 namespace SG {
26 
27 
28 class DataProxy;
29 
30 
37  : public std::bad_cast
38 {
39 public:
45  ExcBadDataProxyCast (CLID id, const std::type_info& tid);
46 
47 
48  // Needed for c++98 compatibility.
49  ~ExcBadDataProxyCast() throw() {}
50 
51 
55  virtual const char* what() const noexcept override;
56 
57 
58 private:
60  std::string m_what;
61 };
62 
63 
69 [[noreturn]]
70 void throwExcBadDataProxyCast (const DataProxy& proxy, const std::type_info& tid);
71 
72 
82  : public std::runtime_error
83 {
84 public:
92  ExcProxyCollision (CLID id, const std::string& key,
93  CLID primary_id, const std::string& primary_key);
94 };
95 
96 
104  : public std::runtime_error
105 {
106 public:
115  ExcSgkeyCollision (const std::string& new_key, CLID new_clid,
116  const std::string& old_key, CLID old_clid,
117  sgkey_t sgkey);
118 };
119 
120 
121 } // namespace SG
122 
123 
124 #endif // not SGTOOLS_EXCEPTIONS_H
common.sgkey
def sgkey(tool)
Definition: common.py:1027
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ExcBadDataProxyCast::ExcBadDataProxyCast
ExcBadDataProxyCast(CLID id, const std::type_info &tid)
Constructor.
Definition: Control/SGTools/src/exceptions.cxx:37
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::throwExcBadDataProxyCast
void throwExcBadDataProxyCast(const DataProxy &proxy, const std::type_info &tid)
Throw an ExcBadDataProxyCast exception.
Definition: Control/SGTools/src/exceptions.cxx:57
SG::ExcBadDataProxyCast
Exception — Bad cast of DataProxy with CLID.
Definition: Control/SGTools/SGTools/exceptions.h:38
DataProxy
DataProxy provides the registry services for StoreGate.
Definition: DataProxy.h:32
SG::ExcBadDataProxyCast::m_what
std::string m_what
The message for this exception.
Definition: Control/SGTools/SGTools/exceptions.h:60
SG::ExcSgkeyCollision
Exception — sgkey hash collision.
Definition: Control/SGTools/SGTools/exceptions.h:105
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
sgkey_t.h
Define the type used for hashed StoreGate key+CLID pairs.
private
#define private
Definition: xAODTruthCnvAlg.h:20
SG::ExcBadDataProxyCast::what
virtual const char * what() const noexcept override
Return the message for this exception.
Definition: Control/SGTools/src/exceptions.cxx:46
SG::DataProxy
Definition: DataProxy.h:45
SG::ExcProxyCollision
Exception — Proxy collision for clid/key.
Definition: Control/SGTools/SGTools/exceptions.h:83
SG::ExcBadDataProxyCast::~ExcBadDataProxyCast
~ExcBadDataProxyCast()
Definition: Control/SGTools/SGTools/exceptions.h:49
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37