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 std

boost::interprocess::std

Synopsis

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

template<typename CharVector, typename CharTraits> 
class std {
public:
  // types
  typedef CharVector                                                               vector_type;
  typedef std::basic_ios< typename CharVector::value_type, CharTraits >::char_type char_type;  
  typedef std::basic_ios< char_type, CharTraits >::int_type                        int_type;   
  typedef std::basic_ios< char_type, CharTraits >::pos_type                        pos_type;   
  typedef std::basic_ios< char_type, CharTraits >::off_type                        off_type;   
  typedef std::basic_ios< char_type, CharTraits >::traits_type                     traits_type;
  typedef basic_vectorbuf< CharVector, CharTraits >                                vectorbuf_t;  // @ private: 
  typedef std::basic_istream< char_type, CharTraits >                              base_t;     
  typedef CharVector                                                               vector_type;
  typedef std::basic_ios< typename CharVector::value_type, CharTraits >::char_type char_type;  
  typedef std::basic_ios< char_type, CharTraits >::int_type                        int_type;   
  typedef std::basic_ios< char_type, CharTraits >::pos_type                        pos_type;   
  typedef std::basic_ios< char_type, CharTraits >::off_type                        off_type;   
  typedef std::basic_ios< char_type, CharTraits >::traits_type                     traits_type;
  typedef basic_vectorbuf< CharVector, CharTraits >                                vectorbuf_t;  // @ private: 
  typedef std::basic_ostream< char_type, CharTraits >                              base_t;     

  // public member functions
  vectorbuf_t & m_buf();
  const vectorbuf_t & m_buf() const;
   basic_ivectorstream(std::ios_base::openmode = std::ios_base::in);
  template<typename VectorParameter> 
     basic_ivectorstream(const VectorParameter &, 
                         std::ios_base::openmode = std::ios_base::in);
   ~basic_ivectorstream();
  basic_vectorbuf< CharVector, CharTraits > * rdbuf() const;
  void swap_vector(vector_type &);
  const vector_type & vector() const;
  void reserve(typename vector_type::size_type);
  void clear();
  vectorbuf_t & m_buf();
  const vectorbuf_t & m_buf() const;
   basic_ovectorstream(std::ios_base::openmode = std::ios_base::out);
  template<typename VectorParameter> 
     basic_ovectorstream(const VectorParameter &, 
                         std::ios_base::openmode = std::ios_base::out);
   ~basic_ovectorstream();
  basic_vectorbuf< CharVector, CharTraits > * rdbuf() const;
  void swap_vector(vector_type &);
  const vector_type & vector() const;
  void reserve(typename vector_type::size_type);
};

Description

A basic_istream class that 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 @ : private basic_vectorbuf<CharVector, CharTraits>

A basic_ostream class that 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 @ : private basic_vectorbuf<CharVector, CharTraits>

std public member functions

  1. vectorbuf_t & m_buf();
  2. const vectorbuf_t & m_buf() const;
  3.  basic_ivectorstream(std::ios_base::openmode mode = std::ios_base::in);

    Constructor. Throws if vector_type default constructor throws.

  4. template<typename VectorParameter> 
       basic_ivectorstream(const VectorParameter & param, 
                           std::ios_base::openmode mode = std::ios_base::in);

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

  5.  ~basic_ivectorstream();
  6. basic_vectorbuf< CharVector, CharTraits > * rdbuf() const;

    Returns the address of the stored stream buffer.

  7. void swap_vector(vector_type & vect);

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

  8. const vector_type & vector() const;

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

  9. void reserve(typename vector_type::size_type size);

    Calls reserve() method of the internal vector. Resets the stream to the first position. Throws if the internals vector's reserve throws.

  10. void clear();

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

  11. vectorbuf_t & m_buf();
  12. const vectorbuf_t & m_buf() const;
  13.  basic_ovectorstream(std::ios_base::openmode mode = std::ios_base::out);

    Constructor. Throws if vector_type default constructor throws.

  14. template<typename VectorParameter> 
       basic_ovectorstream(const VectorParameter & param, 
                           std::ios_base::openmode mode = std::ios_base::out);

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

  15.  ~basic_ovectorstream();
  16. basic_vectorbuf< CharVector, CharTraits > * rdbuf() const;

    Returns the address of the stored stream buffer.

  17. void swap_vector(vector_type & vect);

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

  18. const vector_type & vector() const;

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

  19. void reserve(typename vector_type::size_type size);

    Calls reserve() method of the internal vector. Resets the stream to the first position. Throws if the internals vector's reserve throws.


PrevUpHomeNext