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