• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "boost/coroutine/exceptions.hpp"
8 
9 namespace boost {
10 namespace coroutines {
11 
12 class coroutine_error_category : public system::error_category
13 {
14 public:
name() const15     virtual const char* name() const BOOST_NOEXCEPT
16     { return "coroutine"; }
17 
message(int ev) const18     virtual std::string message( int ev) const
19     {
20         switch (BOOST_SCOPED_ENUM_NATIVE(coroutine_errc)(ev))
21         {
22         case coroutine_errc::no_data:
23             return std::string("Operation not permitted because coroutine "
24                           "has no valid result.");
25         }
26         return std::string("unspecified coroutine_errc value\n");
27     }
28 };
29 
30 BOOST_COROUTINES_DECL
coroutine_category()31 system::error_category const& coroutine_category() BOOST_NOEXCEPT
32 {
33     static coroutines::coroutine_error_category cat;
34     return cat;
35 }
36 
37 }}
38