Realistic 3D camera system
3D camera system components
Public Member Functions | Friends | Related Functions | List of all members
asio::mutable_buffer Class Reference

Holds a buffer that can be modified. More...

#include <buffer.hpp>

Inheritance diagram for asio::mutable_buffer:
asio::mutable_buffers_1

Public Member Functions

 mutable_buffer ()
 Construct an empty buffer. More...
 
 mutable_buffer (void *data, std::size_t size)
 Construct a buffer to represent a given memory range. More...
 

Friends

void * asio::detail::buffer_cast_helper (const mutable_buffer &b)
 
std::size_t asio::detail::buffer_size_helper (const mutable_buffer &b)
 

Related Functions

(Note that these are not member functions.)

mutable_buffer operator+ (const mutable_buffer &b, std::size_t start)
 Create a new modifiable buffer that is offset from the start of another. More...
 
mutable_buffer operator+ (std::size_t start, const mutable_buffer &b)
 Create a new modifiable buffer that is offset from the start of another. More...
 

Detailed Description

Holds a buffer that can be modified.

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

Accessing Buffer Contents

The contents of a buffer may be accessed using the asio::buffer_size and asio::buffer_cast functions:

std::size_t s1 = asio::buffer_size(b1);
unsigned char* p1 = asio::buffer_cast<unsigned char*>(b1);

The asio::buffer_cast function permits violations of type safety, so uses of it in application code should be carefully considered.

Definition at line 91 of file buffer.hpp.

Constructor & Destructor Documentation

asio::mutable_buffer::mutable_buffer ( )
inline

Construct an empty buffer.

Definition at line 95 of file buffer.hpp.

asio::mutable_buffer::mutable_buffer ( void *  data,
std::size_t  size 
)
inline

Construct a buffer to represent a given memory range.

Definition at line 102 of file buffer.hpp.

Friends And Related Function Documentation

void* asio::detail::buffer_cast_helper ( const mutable_buffer b)
friend
std::size_t asio::detail::buffer_size_helper ( const mutable_buffer b)
friend
mutable_buffer operator+ ( const mutable_buffer b,
std::size_t  start 
)
related

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

Definition at line 442 of file buffer.hpp.

mutable_buffer operator+ ( std::size_t  start,
const mutable_buffer b 
)
related

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

Definition at line 459 of file buffer.hpp.


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