exception_list.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef BOOST_THREAD_EXPERIMENTAL_PARALLEL_V1_EXCEPTION_LIST_HPP
  2. #define BOOST_THREAD_EXPERIMENTAL_PARALLEL_V1_EXCEPTION_LIST_HPP
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // (C) Copyright Vicente J. Botet Escriba 2014. Distributed under the Boost
  6. // Software License, Version 1.0. (See accompanying file
  7. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/thread for documentation.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #include <boost/thread/detail/config.hpp>
  13. #include <boost/thread/experimental/parallel/v1/inline_namespace.hpp>
  14. #include <boost/exception_ptr.hpp>
  15. #include <exception>
  16. #include <list>
  17. #include <boost/config/abi_prefix.hpp>
  18. namespace boost
  19. {
  20. namespace experimental
  21. {
  22. namespace parallel
  23. {
  24. BOOST_THREAD_INLINE_NAMESPACE(v1)
  25. {
  26. class BOOST_SYMBOL_VISIBLE exception_list: public std::exception
  27. {
  28. typedef std::list<exception_ptr> exception_ptr_list;
  29. exception_ptr_list list_;
  30. public:
  31. typedef exception_ptr_list::const_iterator const_iterator;
  32. ~exception_list() BOOST_NOEXCEPT_OR_NOTHROW {}
  33. void add(exception_ptr const& e)
  34. {
  35. list_.push_back(e);
  36. }
  37. size_t size() const BOOST_NOEXCEPT
  38. {
  39. return list_.size();
  40. }
  41. const_iterator begin() const BOOST_NOEXCEPT
  42. {
  43. return list_.begin();
  44. }
  45. const_iterator end() const BOOST_NOEXCEPT
  46. {
  47. return list_.end();
  48. }
  49. const char* what() const BOOST_NOEXCEPT_OR_NOTHROW
  50. {
  51. return "exception_list";
  52. }
  53. };
  54. }
  55. } // parallel
  56. } // experimental
  57. } // boost
  58. #include <boost/config/abi_suffix.hpp>
  59. #endif