Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:14:57

0001 // lAger: General Purpose l/A-event Generator
0002 // Copyright (C) 2016-2021 Sylvester Joosten <sjoosten@anl.gov>
0003 // 
0004 // This file is part of lAger.
0005 // 
0006 // lAger is free software: you can redistribute it and/or modify
0007 // it under the terms of the GNU General Public License as published by
0008 // the Free Shoftware Foundation, either version 3 of the License, or
0009 // (at your option) any later version.
0010 // 
0011 // lAger is distributed in the hope that it will be useful,
0012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 // GNU General Public License for more details.
0015 // 
0016 // You should have received a copy of the GNU General Public License
0017 // along with lAger.  If not, see <https://www.gnu.org/licenses/>.
0018 // 
0019 
0020 #ifndef LAGER_CORE_EXCEPTION_LOADED
0021 #define LAGER_CORE_EXCEPTION_LOADED
0022 
0023 #include <exception>
0024 #include <string>
0025 
0026 namespace lager {
0027 class exception : public std::exception {
0028 public:
0029   exception(const std::string& msg, const std::string& type = "exception")
0030       : msg_{msg}, type_{type} {}
0031 
0032   virtual const char* what() const throw() { return msg_.c_str(); }
0033   virtual const char* type() const throw() { return type_.c_str(); }
0034   virtual ~exception() throw() {}
0035 
0036 private:
0037   std::string msg_;
0038   std::string type_;
0039 };
0040 } // ns lager
0041 
0042 #endif