Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:09

0001 //
0002 // connect_pipe.hpp
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_CONNECT_PIPE_HPP
0012 #define BOOST_ASIO_CONNECT_PIPE_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 
0020 #if defined(BOOST_ASIO_HAS_PIPE) \
0021   || defined(GENERATING_DOCUMENTATION)
0022 
0023 #include <boost/asio/basic_readable_pipe.hpp>
0024 #include <boost/asio/basic_writable_pipe.hpp>
0025 #include <boost/asio/error.hpp>
0026 
0027 #include <boost/asio/detail/push_options.hpp>
0028 
0029 namespace boost {
0030 namespace asio {
0031 namespace detail {
0032 
0033 #if defined(BOOST_ASIO_HAS_IOCP)
0034 typedef HANDLE native_pipe_handle;
0035 #else // defined(BOOST_ASIO_HAS_IOCP)
0036 typedef int native_pipe_handle;
0037 #endif // defined(BOOST_ASIO_HAS_IOCP)
0038 
0039 BOOST_ASIO_DECL void create_pipe(native_pipe_handle p[2],
0040     boost::system::error_code& ec);
0041 
0042 BOOST_ASIO_DECL void close_pipe(native_pipe_handle p);
0043 
0044 } // namespace detail
0045 
0046 /// Connect two pipe ends using an anonymous pipe.
0047 /**
0048  * @param read_end The read end of the pipe.
0049  *
0050  * @param write_end The write end of the pipe.
0051  *
0052  * @throws boost::system::system_error Thrown on failure.
0053  */
0054 template <typename Executor1, typename Executor2>
0055 void connect_pipe(basic_readable_pipe<Executor1>& read_end,
0056     basic_writable_pipe<Executor2>& write_end);
0057 
0058 /// Connect two pipe ends using an anonymous pipe.
0059 /**
0060  * @param read_end The read end of the pipe.
0061  *
0062  * @param write_end The write end of the pipe.
0063  *
0064  * @throws boost::system::system_error Thrown on failure.
0065  *
0066  * @param ec Set to indicate what error occurred, if any.
0067  */
0068 template <typename Executor1, typename Executor2>
0069 BOOST_ASIO_SYNC_OP_VOID connect_pipe(basic_readable_pipe<Executor1>& read_end,
0070     basic_writable_pipe<Executor2>& write_end, boost::system::error_code& ec);
0071 
0072 } // namespace asio
0073 } // namespace boost
0074 
0075 #include <boost/asio/detail/pop_options.hpp>
0076 
0077 #include <boost/asio/impl/connect_pipe.hpp>
0078 #if defined(BOOST_ASIO_HEADER_ONLY)
0079 # include <boost/asio/impl/connect_pipe.ipp>
0080 #endif // defined(BOOST_ASIO_HEADER_ONLY)
0081 
0082 #endif // defined(BOOST_ASIO_HAS_PIPE)
0083        //   || defined(GENERATING_DOCUMENTATION)
0084 
0085 #endif // BOOST_ASIO_CONNECT_PIPE_HPP