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

PrevUpHomeNext

Class template basic_bufferbuf

boost::interprocess::basic_bufferbuf

Synopsis

// In header: <boost/interprocess/interprocess_fwd.hpp>

template<typename CharT, typename CharTraits = std::char_traits<CharT> > 
class basic_bufferbuf : public std::basic_streambuf< CharT, CharTraits > {
public:
  // construct/copy/destruct
  explicit basic_bufferbuf(std::ios_base::openmode = std::ios_base::in|std::ios_base::out);
  explicit basic_bufferbuf(CharT *, std::size_t, 
                           std::ios_base::openmode = std::ios_base::in|std::ios_base::out);
  ~basic_bufferbuf();

  // public member functions
  std::pair< CharT *, std::size_t > buffer() const;
  void buffer(CharT *, std::size_t);
};

Description

A streambuf class that controls the transmission of elements to and from a basic_xbufferstream. The elements are transmitted from a to a fixed size buffer

basic_bufferbuf public construct/copy/destruct

  1. explicit basic_bufferbuf(std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);

    Constructor. Does not throw.

  2. explicit basic_bufferbuf(CharT * buf, std::size_t length, 
                             std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);

    Constructor. Assigns formatting buffer. Does not throw.

  3. ~basic_bufferbuf();

basic_bufferbuf public member functions

  1. std::pair< CharT *, std::size_t > buffer() const;

    Returns the pointer and size of the internal buffer. Does not throw.

  2. void buffer(CharT * buf, std::size_t length);

    Sets the underlying buffer to a new value Does not throw.


PrevUpHomeNext