Boost C++ Libraries

...one 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 for the latest Boost documentation.
PrevUpHomeNext

Struct template basic_pipebuf

boost::process::basic_pipebuf

Synopsis

// 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();
  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 &);
  ~basic_pipebuf();

  // 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();
  bool is_open() const;
  basic_pipebuf< CharT, Traits > * open();
  basic_pipebuf< CharT, Traits > * open(const std::string &);
  basic_pipebuf< CharT, Traits > * close();

  // private member functions
  bool _write_impl();

  // public data members
  static constexpr int default_buffer_size;
};

Description

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.
  10. ~basic_pipebuf();
    Destructor -> writes the frest of the data.

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.
  9. bool is_open() const;
    Check if the pipe is open.
  10. basic_pipebuf< CharT, Traits > * open();
    Open a new pipe.
  11. basic_pipebuf< CharT, Traits > * open(const std::string & name);
    Open a new named pipe.
  12. basic_pipebuf< CharT, Traits > * close();
    Flush the buffer & close the pipe.

basic_pipebuf private member functions

  1. bool _write_impl();

PrevUpHomeNext