Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Struct template basic_pipebuf



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

template<typename CharT, typename Traits = std::char_traits<CharT> > 
struct basic_pipebuf : public std::basic_streambuf< CharT, Traits > {
  // types
  typedef basic_pipe< CharT, Traits > pipe_type;  
  typedef CharT                       char_type;  
  typedef Traits                      traits_type;
  typedef Traits::int_type            int_type;   
  typedef Traits::pos_type            pos_type;   
  typedef Traits::off_type            off_type;   

  // construct/copy/destruct
  basic_pipebuf(const basic_pipebuf &) = default;
  basic_pipebuf(basic_pipebuf &&) = default;
  basic_pipebuf(pipe_type &&);
  basic_pipebuf(const pipe_type &);
  basic_pipebuf & operator=(const basic_pipebuf &) = delete;
  basic_pipebuf & operator=(basic_pipebuf &&) = default;
  basic_pipebuf & operator=(pipe_type &&);
  basic_pipebuf & operator=(const pipe_type &);

  // public member functions
  int_type overflow(int_type = traits_type::eof());
  int sync();
  int_type underflow();
  void pipe(pipe_type &&);
  void pipe(const pipe_type &);
  pipe_type & pipe();
  const pipe_type & pipe() const;
  pipe_type && pipe();

  // private member functions
  bool _write_impl();

  // public data members
  static constexpr int default_buffer_size;


Implementation of the stream buffer for a pipe.

basic_pipebuf public construct/copy/destruct

  1. basic_pipebuf();
    Default constructor, will also construct the pipe.
  2. basic_pipebuf(const basic_pipebuf &) = default;
    Copy Constructor.
  3. basic_pipebuf(basic_pipebuf &&) = default;
    Move Constructor.
  4. basic_pipebuf(pipe_type && p);
    Move construct from a pipe.
  5. basic_pipebuf(const pipe_type & p);
    Construct from a pipe.
  6. basic_pipebuf & operator=(const basic_pipebuf &) = delete;
    Copy assign.
  7. basic_pipebuf & operator=(basic_pipebuf &&) = default;
    Move assign.
  8. basic_pipebuf & operator=(pipe_type && p);
    Move assign a pipe.
  9. basic_pipebuf & operator=(const pipe_type & p);
    Copy assign a pipe.

basic_pipebuf public member functions

  1. int_type overflow(int_type ch = traits_type::eof());
    Writes characters to the associated output sequence from the put area.
  2. int sync();
    Synchronizes the buffers with the associated character sequence.
  3. int_type underflow();
    Reads characters from the associated input sequence to the get area.
  4. void pipe(pipe_type && p);
    Set the pipe of the streambuf.
  5. void pipe(const pipe_type & p);
    Set the pipe of the streambuf.
  6. pipe_type & pipe();
    Get a reference to the pipe.
  7. const pipe_type & pipe() const;
    Get a const reference to the pipe.
  8. pipe_type && pipe();
    Get a rvalue reference to the pipe. Qualified as rvalue.

basic_pipebuf private member functions

  1. bool _write_impl();