Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:04

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include <exception>
0012 #include <memory>
0013 #include <string>
0014 
0015 namespace Acts {
0016 class Surface;
0017 
0018 /// @brief Exception type failures to merge two surfaces
0019 class SurfaceMergingException : public std::exception {
0020  public:
0021   SurfaceMergingException(std::weak_ptr<const Surface> surfaceA,
0022                           std::weak_ptr<const Surface> surfaceB,
0023                           const std::string& reason)
0024       : m_surfaceA(std::move(surfaceA)),
0025         m_surfaceB(std::move(surfaceB)),
0026         m_message(std::string{"Failure to merge surfaces: "} + reason) {}
0027 
0028   const char* what() const throw() override { return m_message.c_str(); }
0029 
0030  private:
0031   std::weak_ptr<const Surface> m_surfaceA;
0032   std::weak_ptr<const Surface> m_surfaceB;
0033   std::string m_message;
0034 };
0035 
0036 }  // namespace Acts