Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:01

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 #ifndef PARSERS_EXCEPTIONS_H
0014 #define PARSERS_EXCEPTIONS_H
0015 
0016 // Framework include files
0017 #include <Parsers/config.h>
0018 
0019 // C/C++ include files
0020 #include <string>
0021 #include <typeinfo>
0022 #include <stdexcept>
0023 
0024 /// Namespace for the AIDA detector description toolkit
0025 namespace dd4hep {
0026 
0027   /// Exception class to signal operations on unrelated classes
0028   /**
0029    *   \author  M.Frank
0030    *   \date    13.08.2013
0031    *   \ingroup DD4HEP
0032    */
0033   struct unrelated_type_error : public std::runtime_error {
0034     static std::string msg(const std::type_info& typ1, const std::type_info& typ2, const std::string& text);
0035     unrelated_type_error(const std::type_info& typ1, const std::type_info& typ2, const std::string& text = "")
0036       : std::runtime_error(msg(typ1, typ2, text)) {
0037     }
0038   };
0039 
0040   /// Exception class to signal operations on unrelated types of values
0041   /**
0042    *   \author  M.Frank
0043    *   \date    13.08.2013
0044    *   \ingroup DD4HEP
0045    */
0046   struct unrelated_value_error : public std::runtime_error {
0047     static std::string msg(const std::type_info& typ, const std::string& text);
0048     unrelated_value_error(const std::type_info& typ, const std::string& text = "")
0049       : std::runtime_error(msg(typ, text)) {
0050     }
0051   };
0052 
0053 }      // End namespace dd4hep
0054 
0055 #endif // PARSERS_EXCEPTIONS_H