Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:38:19

0001 //
0002 // Copyright (c) 2023-2025 Ivica Siladic, Bruno Iljazovic, Korina Simicevic
0003 //
0004 // Distributed under the Boost Software License, Version 1.0.
0005 // (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_MQTT5_REBIND_EXECUTOR_HPP
0009 #define BOOST_MQTT5_REBIND_EXECUTOR_HPP
0010 
0011 namespace boost::asio::ssl {
0012 
0013 // forward declare to preserve optional OpenSSL dependency
0014 template <typename Stream>
0015 class stream;
0016 
0017 } // end namespace boost::asio::ssl
0018 
0019 // forward declare to avoid Beast dependency
0020 
0021 namespace boost::beast::websocket {
0022 
0023 template <typename Stream, bool deflate_supported>
0024 class stream;
0025 
0026 }// end namespace boost::beast::websocket
0027 
0028 namespace boost::mqtt5::detail {
0029 
0030 namespace asio = boost::asio;
0031 
0032 template <typename Stream, typename Executor>
0033 struct rebind_executor {
0034     using other = typename Stream::template rebind_executor<Executor>::other;
0035 };
0036 
0037 // asio::ssl::stream does not define a rebind_executor member type
0038 template <typename Stream, typename Executor>
0039 struct rebind_executor<asio::ssl::stream<Stream>, Executor> {
0040     using other = typename asio::ssl::stream<
0041         typename rebind_executor<Stream, Executor>::other
0042     >;
0043 };
0044 
0045 template <typename Stream, bool deflate_supported, typename Executor>
0046 struct rebind_executor<
0047     boost::beast::websocket::stream<asio::ssl::stream<Stream>, deflate_supported>,
0048     Executor
0049 > {
0050     using other = typename boost::beast::websocket::stream<
0051         asio::ssl::stream<typename rebind_executor<Stream, Executor>::other>,
0052         deflate_supported
0053     >;
0054 };
0055 
0056 } // end namespace boost::mqtt5::detail
0057 
0058 #endif // !BOOST_MQTT5_REBIND_EXECUTOR_HPP