Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template basic_vectorbuf

boost::interprocess::basic_vectorbuf

Synopsis

// In header: <boost/interprocess/streams/vectorstream.hpp>

template<typename CharVector, typename CharTraits> 
class basic_vectorbuf : public  {
public:
  // types
  typedef              ;
  typedef  ;  
  typedef    ;   
  typedef    ;   
  typedef    ;   
  typedef              ;

  // construct/copy/destruct
  ( = );
  template<typename VectorParameter> 
    (, 
                              = );

  // public member functions
   ();
   () ;
   ();
   ();
};

Description

A streambuf class that controls the transmission of elements to and from a basic_ivectorstream, basic_ovectorstream or basic_vectorstream. It holds a character vector specified by CharVector template parameter as its formatting buffer. The vector must have contiguous storage, like std::vector, boost::interprocess::vector or boost::interprocess::basic_string

basic_vectorbuf public construct/copy/destruct

  1. ( mode = );

    Constructor. Throws if vector_type default constructor throws.

  2. template<typename VectorParameter> 
      ( param, 
                                mode = );

    Constructor. Throws if vector_type(const VectorParameter &param) throws.

basic_vectorbuf public member functions

  1.  ( vect);

    Swaps the underlying vector with the passed vector. This function resets the read/write position in the stream. Does not throw.

  2.  () ;

    Returns a const reference to the internal vector. Does not throw.

  3.  ( size);

    Preallocates memory from the internal vector. Resets the stream to the first position. Throws if the internals vector's memory allocation throws.

  4.  ();

    Calls clear() method of the internal vector. Resets the stream to the first position.


PrevUpHomeNext