Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:32

0001 //
0002 // Copyright (c) 2017, 2018 James E. King III
0003 //
0004 // Distributed under the Boost Software License, Version 1.0.
0005 // (See accompanying file LICENSE_1_0.txt or copy at
0006 //   https://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // Entropy error class
0009 //
0010 
0011 #ifndef BOOST_UUID_RANDOM_ENTROPY_ERROR_HPP
0012 #define BOOST_UUID_RANDOM_ENTROPY_ERROR_HPP
0013 
0014 #include <boost/config.hpp>
0015 #include <boost/cstdint.hpp>
0016 #include <stdexcept>
0017 #include <string>
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(boost::intmax_t errCode, const std::string& message)
0029         : std::runtime_error(message)
0030         , m_errcode(errCode)
0031     {
0032     }
0033 
0034     virtual boost::intmax_t errcode() const
0035     {
0036         return m_errcode;
0037     }
0038 
0039 private:
0040     boost::intmax_t m_errcode;
0041 };
0042 
0043 } // uuids
0044 } // boost
0045 
0046 #endif // BOOST_UUID_RANDOM_ENTROPY_ERROR_HPP