Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //
0002 // experimental/channel.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_HPP
0012 #define BOOST_ASIO_EXPERIMENTAL_CHANNEL_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/asio/any_io_executor.hpp>
0020 #include <boost/asio/detail/type_traits.hpp>
0021 #include <boost/asio/execution/executor.hpp>
0022 #include <boost/asio/is_executor.hpp>
0023 #include <boost/asio/experimental/basic_channel.hpp>
0024 #include <boost/asio/experimental/channel_traits.hpp>
0025 
0026 #include <boost/asio/detail/push_options.hpp>
0027 
0028 namespace boost {
0029 namespace asio {
0030 namespace experimental {
0031 namespace detail {
0032 
0033 template <typename ExecutorOrSignature, typename = void>
0034 struct channel_type
0035 {
0036   template <typename... Signatures>
0037   struct inner
0038   {
0039     typedef basic_channel<any_io_executor, channel_traits<>,
0040         ExecutorOrSignature, Signatures...> type;
0041   };
0042 };
0043 
0044 template <typename ExecutorOrSignature>
0045 struct channel_type<ExecutorOrSignature,
0046     enable_if_t<
0047       is_executor<ExecutorOrSignature>::value
0048         || execution::is_executor<ExecutorOrSignature>::value
0049     >>
0050 {
0051   template <typename... Signatures>
0052   struct inner
0053   {
0054     typedef basic_channel<ExecutorOrSignature,
0055         channel_traits<>, Signatures...> type;
0056   };
0057 };
0058 
0059 } // namespace detail
0060 
0061 /// Template type alias for common use of channel.
0062 #if defined(GENERATING_DOCUMENTATION)
0063 template <typename ExecutorOrSignature, typename... Signatures>
0064 using channel = basic_channel<
0065     specified_executor_or_any_io_executor, channel_traits<>, signatures...>;
0066 #else // defined(GENERATING_DOCUMENTATION)
0067 template <typename ExecutorOrSignature, typename... Signatures>
0068 using channel = typename detail::channel_type<
0069     ExecutorOrSignature>::template inner<Signatures...>::type;
0070 #endif // defined(GENERATING_DOCUMENTATION)
0071 
0072 } // namespace experimental
0073 } // namespace asio
0074 } // namespace boost
0075 
0076 #include <boost/asio/detail/pop_options.hpp>
0077 
0078 #endif // BOOST_ASIO_EXPERIMENTAL_CHANNEL_HPP