~ubuntu-branches/ubuntu/wily/davix/wily

« back to all changes in this revision

Viewing changes to deps/boost_intern/src/thread/src/future.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2015-07-31 13:17:55 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20150731131755-mizprbmn7ogv33te
Tags: 0.4.1-1
* Update to version 0.4.1
* Implement Multi-Arch support

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// (C) Copyright 2012 Vicente J. Botet Escriba
2
 
// Use, modification and distribution are subject to the
3
 
// Boost Software License, Version 1.0. (See accompanying file
4
 
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
 
 
6
 
#include <boost/thread/detail/config.hpp>
7
 
#ifndef BOOST_NO_EXCEPTIONS
8
 
 
9
 
 
10
 
#include <boost/thread/future_error_code.hpp>
11
 
 
12
 
namespace boost
13
 
{
14
 
 
15
 
  namespace thread_detail
16
 
  {
17
 
 
18
 
    class  future_error_category :
19
 
      public boost::system::error_category
20
 
    {
21
 
    public:
22
 
        virtual const char* name() const BOOST_NOEXCEPT;
23
 
        virtual std::string message(int ev) const;
24
 
    };
25
 
 
26
 
    const char*
27
 
    future_error_category::name() const BOOST_NOEXCEPT
28
 
    {
29
 
        return "future";
30
 
    }
31
 
 
32
 
    std::string
33
 
    future_error_category::message(int ev) const
34
 
    {
35
 
        switch (BOOST_SCOPED_ENUM_NATIVE(future_errc)(ev))
36
 
        {
37
 
        case future_errc::broken_promise:
38
 
            return std::string("The associated promise has been destructed prior "
39
 
                          "to the associated state becoming ready.");
40
 
        case future_errc::future_already_retrieved:
41
 
            return std::string("The future has already been retrieved from "
42
 
                          "the promise or packaged_task.");
43
 
        case future_errc::promise_already_satisfied:
44
 
            return std::string("The state of the promise has already been set.");
45
 
        case future_errc::no_state:
46
 
            return std::string("Operation not permitted on an object without "
47
 
                          "an associated state.");
48
 
        }
49
 
        return std::string("unspecified future_errc value\n");
50
 
    }
51
 
    future_error_category future_error_category_var;
52
 
  }
53
 
 
54
 
  BOOST_THREAD_DECL
55
 
  const system::error_category&
56
 
  future_category() BOOST_NOEXCEPT
57
 
  {
58
 
      return thread_detail::future_error_category_var;
59
 
  }
60
 
 
61
 
}
62
 
#endif
63