BVB Source Codes

mars Show exceptions.hpp Source code

Return Download mars: download exceptions.hpp Source code - Download mars Source code - Type:.hpp
  1.  
  2. //          Copyright Oliver Kowalke 2009.
  3. // Distributed under the Boost Software License, Version 1.0.
  4. //    (See accompanying file LICENSE_1_0.txt or copy at
  5. //          http://www.boost.org/LICENSE_1_0.txt)
  6.  
  7. #ifndef BOOST_COROUTINES_EXCEPTIONS_H
  8. #define BOOST_COROUTINES_EXCEPTIONS_H
  9.  
  10. #include <stdexcept>
  11. #include <string>
  12.  
  13. #include <boost/config.hpp>
  14. #include <boost/detail/scoped_enum_emulation.hpp>
  15. #include <boost/system/error_code.hpp>
  16. #include <boost/system/system_error.hpp>
  17. #include <boost/type_traits/integral_constant.hpp>
  18.  
  19. #include <boost/coroutine/detail/config.hpp>
  20.  
  21. #ifdef BOOST_HAS_ABI_HEADERS
  22. #  include BOOST_ABI_PREFIX
  23. #endif
  24.  
  25. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  26. namespace coroutines {
  27. namespace detail {
  28.  
  29. class forced_unwind : public std::exception {
  30.  
  31. };
  32.  
  33. }
  34.  
  35. BOOST_SCOPED_ENUM_DECLARE_BEGIN(coroutine_errc)
  36. {
  37.   no_data = 1
  38. }
  39. BOOST_SCOPED_ENUM_DECLARE_END(coroutine_errc)
  40.  
  41. BOOST_COROUTINES_DECL
  42. system::error_category const& coroutine_category() BOOST_NOEXCEPT;
  43.  
  44. }
  45.  
  46. namespace system {
  47.  
  48. template<>
  49. struct is_error_code_enum< coroutines::coroutine_errc > : public true_type
  50. {};
  51.  
  52. #ifdef BOOST_NO_CXX11_SCOPED_ENUMS
  53. template<>
  54. struct is_error_code_enum< coroutines::coroutine_errc::enum_type > : public true_type
  55. {};
  56. #endif
  57.  
  58. inline
  59. error_code make_error_code( coroutines::coroutine_errc e) //BOOST_NOEXCEPT
  60. {
  61.     return error_code( underlying_cast< int >( e), coroutines::coroutine_category() );
  62. }
  63.  
  64. inline
  65. error_condition make_error_condition( coroutines::coroutine_errc e) //BOOST_NOEXCEPT
  66. {
  67.     return error_condition( underlying_cast< int >( e), coroutines::coroutine_category() );
  68. }
  69.  
  70. }
  71.  
  72. namespace coroutines {
  73.  
  74. class coroutine_error : public std::logic_error
  75. {
  76. private:
  77.     system::error_code  ec_;
  78.  
  79. public:
  80.     coroutine_error( system::error_code ec) :
  81.         logic_error( ec.message() ),
  82.         ec_( ec)
  83.     {}
  84.  
  85.     system::error_code const& code() const BOOST_NOEXCEPT
  86.     { return ec_; }
  87. };
  88.  
  89. class invalid_result : public coroutine_error
  90. {
  91. public:
  92.     invalid_result() :
  93.         coroutine_error(
  94.             system::make_error_code(
  95.                 coroutine_errc::no_data) )
  96.     {}
  97. };
  98.  
  99. }}
  100.  
  101. #ifdef BOOST_HAS_ABI_HEADERS
  102. #  include BOOST_ABI_SUFFIX
  103. #endif
  104.  
  105. #endif // BOOST_COROUTINES_EXCEPTIONS_H
  106.  
downloadexceptions.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top