asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design
Reference Class Hierarchy | Class Index | Member Index

asio::const_buffer Class Reference

Inherited by asio::const_buffers_1.

Inheritance diagram for asio::const_buffer:

Inheritance graph
List of all members.

Detailed Description

Holds a buffer that cannot be modified.

The const_buffer class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.


Public Member Functions

 const_buffer ()
 Construct an empty buffer.
 const_buffer (const void *data, std::size_t size)
 Construct a buffer to represent a given memory range.
 const_buffer (const mutable_buffer &b)
 Construct a non-modifiable buffer from a modifiable one.

Related Functions

(Note that these are not member functions.)

template<typename PointerToPodType>
PointerToPodType buffer_cast (const const_buffer &b)
 Cast a non-modifiable buffer to a specified pointer to POD type.
std::size_t buffer_size (const const_buffer &b)
 Get the number of bytes in a non-modifiable buffer.
const_buffer operator+ (const const_buffer &b, std::size_t start)
 Create a new non-modifiable buffer that is offset from the start of another.
const_buffer operator+ (std::size_t start, const const_buffer &b)
 Create a new non-modifiable buffer that is offset from the start of another.


Constructor & Destructor Documentation

asio::const_buffer::const_buffer (  ) 

Construct an empty buffer.

asio::const_buffer::const_buffer ( const void *  data,
std::size_t  size 
)

Construct a buffer to represent a given memory range.

asio::const_buffer::const_buffer ( const mutable_buffer b  ) 

Construct a non-modifiable buffer from a modifiable one.


Friends And Related Function Documentation

template<typename PointerToPodType>
PointerToPodType buffer_cast ( const const_buffer b  )  [related]

Cast a non-modifiable buffer to a specified pointer to POD type.

std::size_t buffer_size ( const const_buffer b  )  [related]

Get the number of bytes in a non-modifiable buffer.

const_buffer operator+ ( const const_buffer b,
std::size_t  start 
) [related]

Create a new non-modifiable buffer that is offset from the start of another.

const_buffer operator+ ( std::size_t  start,
const const_buffer b 
) [related]

Create a new non-modifiable buffer that is offset from the start of another.

asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design