Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class async_pipe

boost::process::async_pipe

Synopsis

// In header: <boost/process/async_pipe.hpp>


class async_pipe {
public:
  // types
  typedef           ;
  typedef           ;       
  typedef  ;     

  // construct/copy/destruct
  ();
  (, );
  (, );
  (, , 
             );
  (async_pipe &);
  (async_pipe &&);
  template<typename CharT, typename Traits> 
    (, 
                        basic_pipe< );
  template<typename CharT, typename Traits> 
    (, , 
                        basic_pipe< );
  template<typename CharT, typename Traits> 
    async_pipe & (basic_pipe< );
  async_pipe & (async_pipe &);
  async_pipe & (async_pipe &&);
  ~();

  // public member functions
  template<typename CharT, typename Traits> 
    () ;
   ();
   ();
   ();
   () ;
   ();
  template<typename MutableBufferSequence> 
     ();
  template<typename MutableBufferSequence> 
     ();
   () ;
   () ;
  template<typename MutableBufferSequence, typename ReadHandler> 
     (, );
  template<typename ConstBufferSequence, typename WriteHandler> 
     (, );
   () ;
   () ;
   ();
   ();
   (::);
   (::);
   (::) ;
   (::) ;
};

Description

Class implementing an asnychronous I/O-Object for use with boost.asio. It is based on the corresponding I/O Object, that is either boost::asio::windows::stream_handle or boost::asio::posix::stream_descriptor.

It can be used directly with boost::asio::async_read or async_write.

[Note] Note

The object is copyable, but that does invoke a handle duplicate.

async_pipe public types

  1. typedef ;

    Typedef for the native handle representation.

    [Note] Note

    This is the handle on the system, not the boost.asio class.

  2. typedef ;

    Typedef for the handle representation of boost.asio.

async_pipe public construct/copy/destruct

  1. ( ios);

    Construct a new async_pipe, does automatically open the pipe. Initializes source and sink with the same io_context.

    [Note] Note

    Windows creates a named pipe here, where the name is automatically generated.

  2. ( ios_source, 
                ios_sink);

    Construct a new async_pipe, does automatically open the pipe.

    [Note] Note

    Windows creates a named pipe here, where the name is automatically generated.

  3. ( ios,  name);

    Construct a new async_pipe, does automatically open. Initializes source and sink with the same io_context.

    [Note] Note

    Windows restricts possible names.

  4. ( ios_source, 
                ios_sink,  name);

    Construct a new async_pipe, does automatically open.

    [Note] Note

    Windows restricts possible names.

  5. (async_pipe & lhs);

    Copy-Constructor of the async pipe.

    [Note] Note

    Windows requires a named pipe for this, if a the wrong type is used an exception is thrown.

  6. (async_pipe && lhs);

    Move-Constructor of the async pipe.

  7. template<typename CharT, typename Traits> 
      ( ios, 
                          basic_pipe<  p);

    Construct the async-pipe from a pipe.

    [Note] Note

    Windows requires a named pipe for this, if a the wrong type is used an exception is thrown.

  8. template<typename CharT, typename Traits> 
      ( ios_source, 
                           ios_sink, 
                          basic_pipe<  p);

    Construct the async-pipe from a pipe, with two different io_context objects.

    [Note] Note

    Windows requires a named pipe for this, if a the wrong type is used an exception is thrown.

  9. template<typename CharT, typename Traits> 
      async_pipe & (basic_pipe<  p);

    Assign a basic_pipe.

    [Note] Note

    Windows requires a named pipe for this, if a the wrong type is used an exception is thrown.

  10. async_pipe & (async_pipe & lhs);

    Copy Assign a pipe.

    [Note] Note

    Duplicates the handles.

  11. async_pipe & (async_pipe && lhs);

    Move assign a pipe

  12. ~();

    Destructor. Closes the pipe handles.

async_pipe public member functions

  1. template<typename CharT, typename Traits> 
      () ;

    Explicit cast to basic_pipe.

  2.  ();

    Cancel the current asynchronous operations.

  3.  ();

    Close the pipe handles.

  4.  ( ec);

    Close the pipe handles. While passing an error_code

  5.  () ;

    Check if the pipes are open.

  6.  ();

    Async close, i.e. close after current operation is completed.

    [Note] Note

    There is no guarantee that this will indeed read the entire pipe-buffer

  7. template<typename MutableBufferSequence> 
       ( buffers);

    Read some data from the handle.

    See the boost.asio documentation for more details.

  8. template<typename MutableBufferSequence> 
       ( buffers);

    Write some data to the handle.

    See the boost.asio documentation for more details.

  9.  () ;

    Get the native handle of the source.

  10.  () ;

    Get the native handle of the sink.

  11. template<typename MutableBufferSequence, typename ReadHandler> 
       ( buffers, 
                                   handler);

    Start an asynchronous read.

    See the boost.asio documentation for more details.

  12. template<typename ConstBufferSequence, typename WriteHandler> 
       ( buffers, 
                                    handler);

    Start an asynchronous write.

    See the boost.asio documentation for more details.

  13.  () ;
    Get the asio handle of the pipe sink.
  14.  () ;
    Get the asio handle of the pipe source.
  15.  ();
    Get the asio handle of the pipe sink. Qualified as rvalue.
  16.  ();
    Get the asio handle of the pipe source. Qualified as rvalue.
  17.  (:: ios);
    Move the source out of this class and change the io_context. Qualified as rvalue.
    [Note] Note

    Will always move.

  18.  (:: ios);
    Move the sink out of this class and change the io_context. Qualified as rvalue.
    [Note] Note

    Will always move

  19.  (:: ios) ;
    Copy the source out of this class and change the io_context.
    [Note] Note

    Will always copy.

  20.  (:: ios) ;
    Copy the sink out of this class and change the io_context.
    [Note] Note

    Will always copy


PrevUpHomeNext