Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:43:20

0001 //
0002 // experimental/channel_error.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2025 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_CHANNEL_ERROR_HPP
0012 #define BOOST_ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP
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/system/error_code.hpp>
0020 
0021 #include <boost/asio/detail/push_options.hpp>
0022 
0023 namespace boost {
0024 namespace asio {
0025 namespace experimental {
0026 namespace error {
0027 
0028 enum channel_errors
0029 {
0030   /// The channel was closed.
0031   channel_closed = 1,
0032 
0033   /// The channel was cancelled.
0034   channel_cancelled = 2
0035 };
0036 
0037 extern BOOST_ASIO_DECL
0038 const boost::system::error_category& get_channel_category();
0039 
0040 static const boost::system::error_category&
0041   channel_category BOOST_ASIO_UNUSED_VARIABLE
0042   = boost::asio::experimental::error::get_channel_category();
0043 
0044 } // namespace error
0045 namespace channel_errc {
0046   // Simulates a scoped enum.
0047   using error::channel_closed;
0048   using error::channel_cancelled;
0049 } // namespace channel_errc
0050 } // namespace experimental
0051 } // namespace asio
0052 } // namespace boost
0053 
0054 namespace boost {
0055 namespace system {
0056 
0057 template<> struct is_error_code_enum<
0058     boost::asio::experimental::error::channel_errors>
0059 {
0060   static const bool value = true;
0061 };
0062 
0063 } // namespace system
0064 } // namespace boost
0065 
0066 namespace boost {
0067 namespace asio {
0068 namespace experimental {
0069 namespace error {
0070 
0071 inline boost::system::error_code make_error_code(channel_errors e)
0072 {
0073   return boost::system::error_code(
0074       static_cast<int>(e), get_channel_category());
0075 }
0076 
0077 } // namespace error
0078 } // namespace experimental
0079 } // namespace asio
0080 } // namespace boost
0081 
0082 #include <boost/asio/detail/pop_options.hpp>
0083 
0084 #if defined(BOOST_ASIO_HEADER_ONLY)
0085 # include <boost/asio/experimental/impl/channel_error.ipp>
0086 #endif // defined(BOOST_ASIO_HEADER_ONLY)
0087 
0088 #endif // BOOST_ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP