asio::basic_streambuf< Allocator > Class Template Reference

Automatically resizable buffer class based on std::streambuf. More...

#include <basic_streambuf.hpp>

Inherits asio::detail::noncopyable.

List of all members.

Public Types

typedef asio::const_buffers_1 const_buffers_type
typedef asio::mutable_buffers_1 mutable_buffers_type

Public Member Functions

 basic_streambuf (std::size_t max_size=(std::numeric_limits< std::size_t >::max)(), const Allocator &allocator=Allocator())
 Construct a buffer with a specified maximum size.
std::size_t size () const
 Return the size of the get area in characters.
std::size_t max_size () const
 Return the maximum size of the buffer.
const_buffers_type data () const
 Get a list of buffers that represents the get area.
mutable_buffers_type prepare (std::size_t size)
 Get a list of buffers that represents the put area, with the given size.
void commit (std::size_t n)
 Move the start of the put area by the specified number of characters.
void consume (std::size_t n)
 Move the start of the get area by the specified number of characters.

Protected Types

enum  { buffer_delta = 128 }

Protected Member Functions

int_type underflow ()
int_type overflow (int_type c)
void reserve (std::size_t n)

Private Attributes

std::size_t max_size_
std::vector< char_type, Allocator > buffer_


Detailed Description

template<typename Allocator = std::allocator<char>>
class asio::basic_streambuf< Allocator >

Automatically resizable buffer class based on std::streambuf.

Definition at line 36 of file basic_streambuf.hpp.


Member Typedef Documentation

template<typename Allocator = std::allocator<char>>
typedef asio::const_buffers_1 asio::basic_streambuf< Allocator >::const_buffers_type

Definition at line 48 of file basic_streambuf.hpp.

template<typename Allocator = std::allocator<char>>
typedef asio::mutable_buffers_1 asio::basic_streambuf< Allocator >::mutable_buffers_type

Definition at line 49 of file basic_streambuf.hpp.


Member Enumeration Documentation

template<typename Allocator = std::allocator<char>>
anonymous enum [protected]

Enumerator:
buffer_delta 

Definition at line 111 of file basic_streambuf.hpp.


Constructor & Destructor Documentation

template<typename Allocator = std::allocator<char>>
asio::basic_streambuf< Allocator >::basic_streambuf ( std::size_t  max_size = (std::numeric_limits<std::size_t>::max)(),
const Allocator &  allocator = Allocator() 
) [inline, explicit]


Member Function Documentation

template<typename Allocator = std::allocator<char>>
std::size_t asio::basic_streambuf< Allocator >::size (  )  const [inline]

Return the size of the get area in characters.

Definition at line 66 of file basic_streambuf.hpp.

Referenced by asio::async_read(), asio::async_read_until(), asio::read(), and asio::read_until().

template<typename Allocator = std::allocator<char>>
std::size_t asio::basic_streambuf< Allocator >::max_size (  )  const [inline]

Return the maximum size of the buffer.

Definition at line 72 of file basic_streambuf.hpp.

References asio::basic_streambuf< Allocator >::max_size_.

Referenced by asio::async_read(), asio::async_read_until(), asio::read(), and asio::read_until().

template<typename Allocator = std::allocator<char>>
const_buffers_type asio::basic_streambuf< Allocator >::data (  )  const [inline]

Get a list of buffers that represents the get area.

Definition at line 78 of file basic_streambuf.hpp.

References asio::buffer().

Referenced by asio::async_read_until(), asio::async_write(), asio::read_until(), and asio::write().

template<typename Allocator = std::allocator<char>>
mutable_buffers_type asio::basic_streambuf< Allocator >::prepare ( std::size_t  size  )  [inline]

Get a list of buffers that represents the put area, with the given size.

Definition at line 85 of file basic_streambuf.hpp.

References asio::buffer(), and asio::basic_streambuf< Allocator >::reserve().

Referenced by asio::async_read(), asio::async_read_until(), asio::read(), and asio::read_until().

template<typename Allocator = std::allocator<char>>
void asio::basic_streambuf< Allocator >::commit ( std::size_t  n  )  [inline]

Move the start of the put area by the specified number of characters.

Definition at line 93 of file basic_streambuf.hpp.

Referenced by asio::read(), and asio::read_until().

template<typename Allocator = std::allocator<char>>
void asio::basic_streambuf< Allocator >::consume ( std::size_t  n  )  [inline]

Move the start of the get area by the specified number of characters.

Definition at line 101 of file basic_streambuf.hpp.

Referenced by asio::write().

template<typename Allocator = std::allocator<char>>
int_type asio::basic_streambuf< Allocator >::underflow (  )  [inline, protected]

Definition at line 113 of file basic_streambuf.hpp.

References asio::basic_streambuf< Allocator >::buffer_.

template<typename Allocator = std::allocator<char>>
int_type asio::basic_streambuf< Allocator >::overflow ( int_type  c  )  [inline, protected]

template<typename Allocator = std::allocator<char>>
void asio::basic_streambuf< Allocator >::reserve ( std::size_t  n  )  [inline, protected]


Member Data Documentation

template<typename Allocator = std::allocator<char>>
std::size_t asio::basic_streambuf< Allocator >::max_size_ [private]

template<typename Allocator = std::allocator<char>>
std::vector<char_type, Allocator> asio::basic_streambuf< Allocator >::buffer_ [private]


The documentation for this class was generated from the following file:

Generated on Sun May 25 00:21:27 2008 by  doxygen 1.5.6