Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:51

0001 //
0002 // experimental/impl/channel_error.ipp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_EXPERIMENTAL_IMPL_CHANNEL_ERROR_IPP
0012 #define BOOST_ASIO_EXPERIMENTAL_IMPL_CHANNEL_ERROR_IPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/experimental/channel_error.hpp>
0020 
0021 #include <boost/asio/detail/push_options.hpp>
0022 
0023 namespace boost {
0024 namespace asio {
0025 namespace experimental {
0026 namespace error {
0027 namespace detail {
0028 
0029 class channel_category : public boost::system::error_category
0030 {
0031 public:
0032   const char* name() const noexcept
0033   {
0034     return "asio.channel";
0035   }
0036 
0037   std::string message(int value) const
0038   {
0039     switch (value)
0040     {
0041     case channel_closed: return "Channel closed";
0042     case channel_cancelled: return "Channel cancelled";
0043     default: return "asio.channel error";
0044     }
0045   }
0046 };
0047 
0048 } // namespace detail
0049 
0050 const boost::system::error_category& get_channel_category()
0051 {
0052   static detail::channel_category instance;
0053   return instance;
0054 }
0055 
0056 } // namespace error
0057 } // namespace experimental
0058 } // namespace asio
0059 } // namespace boost
0060 
0061 #include <boost/asio/detail/pop_options.hpp>
0062 
0063 #endif // BOOST_ASIO_EXPERIMENTAL_IMPL_CHANNEL_ERROR_IPP