Skip to content
Snippets Groups Projects
Select Git revision
  • fc8dffa84fd26cbc67cebb895a75204060327ae8
  • develop default protected
  • feature/advection
  • feature/composite-scheme-other-fluxes
  • origin/stage/bouguettaia
  • save_clemence
  • feature/local-dt-fsi
  • feature/variational-hydro
  • feature/gmsh-reader
  • feature/reconstruction
  • feature/kinetic-schemes
  • feature/composite-scheme-sources
  • feature/serraille
  • feature/composite-scheme
  • hyperplastic
  • feature/polynomials
  • feature/gks
  • feature/implicit-solver-o2
  • feature/coupling_module
  • feature/implicit-solver
  • feature/merge-local-dt-fsi
  • v0.5.0 protected
  • v0.4.1 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0 protected
  • Kidder
  • v0.0.4 protected
  • v0.0.3 protected
  • v0.0.2 protected
  • v0 protected
  • v0.0.1 protected
33 results

DiscreteFunctionVectorIntegrator.hpp

Blame
  • Exceptions.hpp 2.15 KiB
    #ifndef EXCEPTIONS_HPP
    #define EXCEPTIONS_HPP
    
    #include <stdexcept>
    #include <string>
    #include <string_view>
    
    #include <experimental/source_location>
    
    struct IExitError : public std::runtime_error
    {
      IExitError(std::string_view error_msg) : std::runtime_error(std::string{error_msg}){};
    
      IExitError(const IExitError&) = delete;
      IExitError(IExitError&&)      = delete;
    
      virtual ~IExitError() = default;
    };
    
    struct RawError : public IExitError
    {
      RawError(const RawError&) = delete;
      RawError(RawError&&)      = delete;
    
      RawError(std::string_view error_msg);
    };
    
    struct NormalError : public IExitError
    {
      NormalError(const NormalError&) = delete;
      NormalError(NormalError&&)      = delete;
    
      NormalError(std::string_view error_msg);
    };
    
    struct IBacktraceError : public std::runtime_error
    {
      virtual const std::experimental::source_location& sourceLocation() const = 0;
    
      IBacktraceError(const IBacktraceError&) = delete;
      IBacktraceError(IBacktraceError&&)      = delete;
    
      IBacktraceError(const std::string& error_msg) : std::runtime_error(std::string{error_msg}){};
      virtual ~IBacktraceError() = default;
    };
    
    class UnexpectedError final : public IBacktraceError
    {
     private:
      const std::experimental::source_location m_source_location;
    
     public:
      const std::experimental::source_location&
      sourceLocation() const
      {
        return m_source_location;
      }
    
      UnexpectedError(const UnexpectedError&) = delete;
      UnexpectedError(UnexpectedError&&)      = delete;
    
      UnexpectedError(std::string_view error_msg,
                      const std::experimental::source_location& = std::experimental::source_location::current());
    };
    
    class NotImplementedError final : public IBacktraceError
    {
     private:
      const std::experimental::source_location m_source_location;
    
     public:
      const std::experimental::source_location&
      sourceLocation() const
      {
        return m_source_location;
      }
    
      NotImplementedError(const NotImplementedError&) = delete;
      NotImplementedError(NotImplementedError&&)      = delete;
    
      NotImplementedError(std::string_view error_msg,
                          const std::experimental::source_location& = std::experimental::source_location::current());
    };
    
    #endif   // EXCEPTIONS_HPP