File indexing completed on 2025-01-18 09:52:47
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_THREAD_FUTURES_FUTURE_ERROR_HPP
0009 #define BOOST_THREAD_FUTURES_FUTURE_ERROR_HPP
0010
0011 #include <boost/thread/detail/config.hpp>
0012
0013 #include <boost/thread/futures/future_error_code.hpp>
0014 #include <boost/system/error_code.hpp>
0015
0016 #include <stdexcept>
0017
0018 namespace boost
0019 {
0020 class BOOST_SYMBOL_VISIBLE future_error
0021 : public std::logic_error
0022 {
0023 system::error_code ec_;
0024 public:
0025 future_error(system::error_code ec)
0026 : logic_error(ec.message()),
0027 ec_(ec)
0028 {
0029 }
0030
0031 const system::error_code& code() const BOOST_NOEXCEPT
0032 {
0033 return ec_;
0034 }
0035 };
0036
0037 class BOOST_SYMBOL_VISIBLE future_uninitialized:
0038 public future_error
0039 {
0040 public:
0041 future_uninitialized() :
0042 future_error(system::make_error_code(future_errc::no_state))
0043 {}
0044 };
0045 class BOOST_SYMBOL_VISIBLE broken_promise:
0046 public future_error
0047 {
0048 public:
0049 broken_promise():
0050 future_error(system::make_error_code(future_errc::broken_promise))
0051 {}
0052 };
0053 class BOOST_SYMBOL_VISIBLE future_already_retrieved:
0054 public future_error
0055 {
0056 public:
0057 future_already_retrieved():
0058 future_error(system::make_error_code(future_errc::future_already_retrieved))
0059 {}
0060 };
0061 class BOOST_SYMBOL_VISIBLE promise_already_satisfied:
0062 public future_error
0063 {
0064 public:
0065 promise_already_satisfied():
0066 future_error(system::make_error_code(future_errc::promise_already_satisfied))
0067 {}
0068 };
0069
0070 class BOOST_SYMBOL_VISIBLE task_already_started:
0071 public future_error
0072 {
0073 public:
0074 task_already_started():
0075 future_error(system::make_error_code(future_errc::promise_already_satisfied))
0076 {}
0077 };
0078
0079 class BOOST_SYMBOL_VISIBLE task_moved:
0080 public future_error
0081 {
0082 public:
0083 task_moved():
0084 future_error(system::make_error_code(future_errc::no_state))
0085 {}
0086 };
0087
0088 class promise_moved:
0089 public future_error
0090 {
0091 public:
0092 promise_moved():
0093 future_error(system::make_error_code(future_errc::no_state))
0094 {}
0095 };
0096 }
0097
0098 #endif