Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:50:32

0001 #ifndef BOOST_UUID_ENTROPY_ERROR_HPP_INCLUDED
0002 #define BOOST_UUID_ENTROPY_ERROR_HPP_INCLUDED
0003 
0004 //
0005 // Copyright (c) 2017, 2018 James E. King III
0006 //
0007 // Distributed under the Boost Software License, Version 1.0.
0008 // (See accompanying file LICENSE_1_0.txt or copy at
0009 //   https://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // Entropy error class
0012 //
0013 
0014 #include <boost/config.hpp>
0015 #include <stdexcept>
0016 #include <string>
0017 #include <cstdint>
0018 
0019 namespace boost {
0020 namespace uuids {
0021 
0022 //! \brief Given boost::system::system_error is in a module that
0023 //!        is not header-only, we define our own exception type
0024 //!        to handle entropy provider errors instead,
0025 class BOOST_SYMBOL_VISIBLE entropy_error : public std::runtime_error
0026 {
0027 public:
0028     entropy_error(std::intmax_t errCode, const std::string& message)
0029         : std::runtime_error(message)
0030         , m_errcode(errCode)
0031     {
0032     }
0033 
0034     virtual std::intmax_t errcode() const
0035     {
0036         return m_errcode;
0037     }
0038 
0039 private:
0040     std::intmax_t m_errcode;
0041 };
0042 
0043 } // uuids
0044 } // boost
0045 
0046 #endif // BOOST_UUID_ENTROPY_ERROR_HPP_INCLUDED