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

Class template basic_opstream

boost::process::basic_opstream

Synopsis

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

template<typename CharT, typename Traits = std::char_traits<CharT> > 
class basic_opstream : public std::basic_ostream< CharT, Traits > {
public:
  // 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_opstream();
  basic_opstream(const basic_opstream &) = delete;
  basic_opstream(basic_opstream &&);
  basic_opstream(pipe_type &&);
  basic_opstream(const pipe_type &);
  basic_opstream & operator=(const basic_opstream &) = delete;
  basic_opstream & operator=(basic_opstream &&);
  basic_opstream & operator=(pipe_type &&);
  basic_opstream & operator=(const pipe_type &);

  // public member functions
  basic_pipebuf< CharT, Traits > * rdbuf() const;
  void pipe(pipe_type &&);
  void pipe(const pipe_type &);
  pipe_type & pipe();
  const pipe_type & pipe() const;
  pipe_type && pipe();
  void open();
  void open(const std::string &);
  void close();
};

Description

Implementation of a write pipe stream.

basic_opstream public construct/copy/destruct

  1. basic_opstream();
    Default constructor.
  2. basic_opstream(const basic_opstream &) = delete;
    Copy constructor.
  3. basic_opstream(basic_opstream && lhs);
    Move constructor.
  4. basic_opstream(pipe_type && p);
    Move construct from a pipe.
  5. basic_opstream(const pipe_type & p);
    Copy construct from a pipe.
  6. basic_opstream & operator=(const basic_opstream &) = delete;
    Copy assignment.
  7. basic_opstream & operator=(basic_opstream && lhs);
    Move assignment.
  8. basic_opstream & operator=(pipe_type && p);
    Move assignment of a pipe.
  9. basic_opstream & operator=(const pipe_type & p);
    Copy assignment of a pipe.

basic_opstream public member functions

  1. basic_pipebuf< CharT, Traits > * rdbuf() const;
    Get access to the underlying stream_buf.
  2. void pipe(pipe_type && p);
    Set the pipe of the streambuf.
  3. void pipe(const pipe_type & p);
    Set the pipe of the streambuf.
  4. pipe_type & pipe();
    Get a reference to the pipe.
  5. const pipe_type & pipe() const;
    Get a const reference to the pipe.
  6. pipe_type && pipe();
    Get a rvalue reference to the pipe. Qualified as rvalue.
  7. void open();
    Open a new pipe.
  8. void open(const std::string & name);
    Open a new named pipe.
  9. void close();
    Flush the buffer & close the pipe.

PrevUpHomeNext