ATLAS Offline Software
Loading...
Searching...
No Matches
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*/
12
13
14#ifndef SGTOOLS_EXCEPTIONS_H
15#define SGTOOLS_EXCEPTIONS_H
16
17
18#include "SGCore/sgkey_t.h"
19#include "GaudiKernel/ClassID.h"
20#include <typeinfo>
21#include <stdexcept>
22#include <string>
23
24
25namespace SG {
26
27
28class DataProxy;
29
30
37 : public std::bad_cast
38{
39public:
45 ExcBadDataProxyCast (CLID id, const std::type_info& tid);
46
47
48 // Needed for c++98 compatibility.
50
51
55 virtual const char* what() const noexcept override;
56
57
60 std::string m_what;
61};
62
63
69[[noreturn]]
70void throwExcBadDataProxyCast (const DataProxy& proxy, const std::type_info& tid);
71
72
82 : public std::runtime_error
83{
84public:
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{
106public:
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
uint32_t CLID
The Class ID type.
virtual const char * what() const noexcept override
Return the message for this exception.
std::string m_what
The message for this exception.
ExcBadDataProxyCast(CLID id, const std::type_info &tid)
Constructor.
ExcProxyCollision(CLID id, const std::string &key, CLID primary_id, const std::string &primary_key)
Constructor.
ExcSgkeyCollision(const std::string &new_key, CLID new_clid, const std::string &old_key, CLID old_clid, sgkey_t sgkey)
Constructor.
STL class.
Forward declaration.
void throwExcBadDataProxyCast(const DataProxy &proxy, const std::type_info &tid)
Throw an ExcBadDataProxyCast exception.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32
STL namespace.
#define private