| Home | Libraries | People | FAQ | More

# boost::asio::basic_streambuf< Allocator > Class Template Reference

Inherits noncopyable.

Inheritance diagram for boost::asio::basic_streambuf< Allocator >:

List of all members.

## Detailed Description

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

Automatically resizable buffer class based on std::streambuf.

## Public Types

typedef implementation_defined | const_buffers_type
| The type used to represent the get area as a list of buffers.
typedef implementation_defined | mutable_buffers_type
| The type used to represent the put area as a list of buffers.

## 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.
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.

## Member Typedef Documentation

template<typename Allocator = std::allocator<char>>

typedef implementation_defined boost::asio::basic_streambuf< Allocator >::const_buffers_type

The type used to represent the get area as a list of buffers.

template<typename Allocator = std::allocator<char>>

typedef implementation_defined boost::asio::basic_streambuf< Allocator >::mutable_buffers_type

The type used to represent the put area as a list of buffers.

## Constructor & Destructor Documentation

template<typename Allocator = std::allocator<char>>

boost::asio::basic_streambuf< Allocator >::basic_streambuf | ( | std::size_t | max_size = `(std::numeric_limits<std::size_t>::max)()`,
|  | const Allocator & | allocator = `Allocator()` |
| ) |  |  | `[explicit]`

Construct a buffer with a specified maximum size.

## Member Function Documentation

template<typename Allocator = std::allocator<char>>

std::size_t boost::asio::basic_streambuf< Allocator >::size | ( |  | ) | const

Return the size of the get area in characters.

template<typename Allocator = std::allocator<char>>

const_buffers_type boost::asio::basic_streambuf< Allocator >::data | ( |  | ) | const

Get a list of buffers that represents the get area.

template<typename Allocator = std::allocator<char>>

mutable_buffers_type boost::asio::basic_streambuf< Allocator >::prepare | ( | std::size_t | size | ) |

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

template<typename Allocator = std::allocator<char>>

void boost::asio::basic_streambuf< Allocator >::commit | ( | std::size_t | n | ) |

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

template<typename Allocator = std::allocator<char>>

void boost::asio::basic_streambuf< Allocator >::consume | ( | std::size_t | n | ) |

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

| Copyright © 2003 - 2006 Christopher M. Kohlhoff