00001 // This file's extension implies that it's C, but it's really -*- C++ -*-. 00002 // $Id: exceptions.h 602555 2014-06-19 03:09:29Z ssnyder $ 00011 #ifndef ATHCONTAINERS_EXCEPTIONS_H 00012 #define ATHCONTAINERS_EXCEPTIONS_H 00013 00014 00015 #include "AthContainersInterfaces/AuxTypes.h" 00016 #include "CxxUtils/noreturn.h" 00017 #include <stdexcept> 00018 #include <typeinfo> 00019 #include <string> 00020 00021 00022 namespace SG { 00023 00024 00031 class ExcNoAuxStore 00032 : public std::runtime_error 00033 { 00034 public: 00039 ExcNoAuxStore (SG::auxid_t auxid); 00040 00041 00046 ExcNoAuxStore (const char* op); 00047 }; 00048 00049 00056 class ExcBadAuxVar 00057 : public std::runtime_error 00058 { 00059 public: 00064 ExcBadAuxVar (SG::auxid_t auxid); 00065 }; 00066 00067 00074 class ExcConstAuxData 00075 : public std::runtime_error 00076 { 00077 public: 00083 ExcConstAuxData (const std::string& op, SG::auxid_t auxid = null_auxid); 00084 }; 00085 00086 00092 class ExcUntrackedSetStore 00093 : public std::runtime_error 00094 { 00095 public: 00099 ExcUntrackedSetStore(); 00100 }; 00101 00102 00103 00110 class ExcBadPrivateStore 00111 : public std::runtime_error 00112 { 00113 public: 00118 ExcBadPrivateStore (const std::string& op); 00119 }; 00120 00121 00122 00129 class ExcAuxTypeMismatch 00130 : public std::runtime_error 00131 { 00132 public: 00139 ExcAuxTypeMismatch (SG::auxid_t auxid, 00140 const std::type_info& new_type, 00141 const std::type_info& old_type); 00142 }; 00143 00144 00145 00153 class ExcInsertionInBaseClass 00154 : public std::runtime_error 00155 { 00156 public: 00163 ExcInsertionInBaseClass (const char* op, 00164 const std::type_info& base_type, 00165 const std::type_info& complete_type); 00166 }; 00167 00168 00176 class ExcStoreLocked 00177 : public std::runtime_error 00178 { 00179 public: 00184 ExcStoreLocked (SG::auxid_t auxid); 00185 00186 00191 ExcStoreLocked (const char* op); 00192 }; 00193 00194 00201 class ExcNonowningContainer 00202 : public std::runtime_error 00203 { 00204 public: 00208 ExcNonowningContainer(); 00209 }; 00210 00211 00215 ATH_NORETURN(void throwExcNonowningContainer()); 00216 00217 00225 class ExcUnknownAuxItem 00226 : public std::runtime_error 00227 { 00228 public: 00235 ExcUnknownAuxItem (const std::string& name, 00236 const std::string& clsname = "", 00237 const std::type_info* typ = 0); 00238 }; 00239 00240 00247 ATH_NORETURN(void throwExcUnknownAuxItem (const std::string& name, 00248 const std::string& clsname = "", 00249 const std::type_info* typ = 0)); 00250 00251 00252 } // namespace SG 00253 00254 00255 #endif // not ATHCONTAINERS_EXCEPTIONS_H