Classes | Typedefs | Functions | Variables

Buffer

API user should create buffers with one of these methods. More...

Classes

class  ana::detail::copying_buffer
 A buffer to be constructed from different buffers that can duplicate the other and hold a local copy that will destruct with the object itself. More...

Typedefs

typedef boost::shared_ptr
< detail::copying_buffer > 
ana::detail::shared_buffer
 A buffer that can be shared by many users.

Functions

void ana::detail::read_buffer_implementation::resize (size_t new_size)
 Resize the buffer, this won't affect the amount of memory usage.
 ana::detail::read_buffer_implementation::~read_buffer_implementation ()
 Deletes the buffer from heap.
char * ana::detail::read_buffer_implementation::base_char () const
 Get the base address.
void * ana::detail::read_buffer_implementation::base () const
 Get the base address.
size_t ana::detail::read_buffer_implementation::size () const
 Get the size of the buffer.
std::string ana::detail::read_buffer_implementation::string ()
 Create a string from the buffer.
template<class T >
void ana::detail::read_buffer_implementation::copy_to (T &x)
size_t ana::detail::copying_buffer::size () const
void * ana::detail::copying_buffer::base () const
char * ana::detail::copying_buffer::base_char () const
 ana::detail::copying_buffer::~copying_buffer ()

Variables

char * ana::detail::read_buffer_implementation::base_
size_t ana::detail::read_buffer_implementation::size_
const size_t ana::detail::copying_buffer::size_
void * ana::detail::copying_buffer::base_
const bool ana::detail::copying_buffer::copy_

Buffer creation methods



boost::asio::mutable_buffers_1 ana::buffer (const boost::asio::mutable_buffer &b)
boost::asio::mutable_buffers_1 ana::buffer (const boost::asio::mutable_buffer &b, std::size_t max_size_in_bytes)
boost::asio::const_buffers_1 ana::buffer (const boost::asio::const_buffer &b)
boost::asio::const_buffers_1 ana::buffer (const boost::asio::const_buffer &b, std::size_t max_size_in_bytes)
boost::asio::mutable_buffers_1 ana::buffer (void *data, std::size_t size_in_bytes)
boost::asio::const_buffers_1 ana::buffer (const void *data, std::size_t size_in_bytes)
template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer (PodType &data)
template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer (PodType &data, std::size_t max_size_in_bytes)
template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer (const PodType &data)
template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer (const PodType &data, std::size_t max_size_in_bytes)
template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer (boost::array< PodType, N > &data)
template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer (boost::array< PodType, N > &data, std::size_t max_size_in_bytes)
template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer (boost::array< const PodType, N > &data)
template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer (boost::array< const PodType, N > &data, std::size_t max_size_in_bytes)
template<typename PodType , typename Allocator >
boost::asio::mutable_buffers_1 ana::buffer (std::vector< PodType, Allocator > &data)
template<typename PodType , typename Allocator >
boost::asio::mutable_buffers_1 ana::buffer (std::vector< PodType, Allocator > &data, std::size_t max_size_in_bytes)
template<typename PodType , typename Allocator >
boost::asio::const_buffers_1 ana::buffer (const std::vector< PodType, Allocator > &data)
template<typename PodType , typename Allocator >
boost::asio::const_buffers_1 ana::buffer (const std::vector< PodType, Allocator > &data, std::size_t max_size_in_bytes)
boost::asio::const_buffers_1 ana::buffer (const std::string &data)
boost::asio::const_buffers_1 ana::buffer (const std::string &data, std::size_t max_size_in_bytes)

Detailed Description

API user should create buffers with one of these methods.

Paraphrasing boost asio's documentation on the buffer function: The ana::buffer function is used to create a buffer object to represent raw memory, an array of POD elements, a vector of POD elements, or a std::string.

Check: <http://think-async.com/Asio/boost_asio_1_3_1/doc/html/boost_asio/reference/buffer.html>


Typedef Documentation

typedef boost::shared_ptr<detail::copying_buffer> ana::detail::shared_buffer

A buffer that can be shared by many users.

Definition at line 166 of file buffers.hpp.


Function Documentation

void* ana::detail::read_buffer_implementation::base (  )  const [inline, inherited]

Get the base address.

Returns:
A void* to the base address of the buffer.

Definition at line 98 of file buffers.hpp.

References ana::detail::read_buffer_implementation::base_.

Referenced by ana::detail::read_buffer_implementation::copy_to().

Here is the caller graph for this function:

void* ana::detail::copying_buffer::base (  )  const [inline, inherited]

Definition at line 150 of file buffers.hpp.

References ana::detail::copying_buffer::base_.

char* ana::detail::read_buffer_implementation::base_char (  )  const [inline, inherited]

Get the base address.

Returns:
A char* to the base address of the buffer.

Definition at line 88 of file buffers.hpp.

References ana::detail::read_buffer_implementation::base_.

char* ana::detail::copying_buffer::base_char (  )  const [inline, inherited]

Definition at line 152 of file buffers.hpp.

References ana::detail::copying_buffer::base_.

template<typename PodType , typename Allocator >
boost::asio::const_buffers_1 ana::buffer ( const std::vector< PodType, Allocator > &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 304 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , typename Allocator >
boost::asio::mutable_buffers_1 ana::buffer ( std::vector< PodType, Allocator > &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 291 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::const_buffers_1 ana::buffer ( const std::string &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 315 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer ( boost::array< const PodType, N > &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 278 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::mutable_buffers_1 ana::buffer ( void *  data,
std::size_t  size_in_bytes 
) [inline]

Definition at line 211 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer ( boost::array< PodType, N > &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 252 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::const_buffers_1 ana::buffer ( const void *  data,
std::size_t  size_in_bytes 
) [inline]

Definition at line 216 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer ( const PodType &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 240 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer ( PodType &  data  )  [inline]

Definition at line 222 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer ( PodType &  data,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 228 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::const_buffers_1 ana::buffer ( const std::string &  data  )  [inline]

Definition at line 310 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer ( const PodType &  data  )  [inline]

Definition at line 234 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::mutable_buffers_1 ana::buffer ( boost::array< PodType, N > &  data  )  [inline]

Definition at line 246 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::const_buffers_1 ana::buffer ( const boost::asio::const_buffer &  b,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 205 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , typename Allocator >
boost::asio::const_buffers_1 ana::buffer ( const std::vector< PodType, Allocator > &  data  )  [inline]

Definition at line 298 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , typename Allocator >
boost::asio::mutable_buffers_1 ana::buffer ( std::vector< PodType, Allocator > &  data  )  [inline]

Definition at line 285 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<typename PodType , std::size_t N>
boost::asio::const_buffers_1 ana::buffer ( boost::array< const PodType, N > &  data  )  [inline]

Definition at line 272 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::mutable_buffers_1 ana::buffer ( const boost::asio::mutable_buffer &  b  )  [inline]
boost::asio::mutable_buffers_1 ana::buffer ( const boost::asio::mutable_buffer &  b,
std::size_t  max_size_in_bytes 
) [inline]

Definition at line 194 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

boost::asio::const_buffers_1 ana::buffer ( const boost::asio::const_buffer &  b  )  [inline]

Definition at line 200 of file buffers.hpp.

References ana::buffer().

Here is the call graph for this function:

template<class T >
void ana::detail::read_buffer_implementation::copy_to ( T &  x  )  [inline, inherited]

Definition at line 116 of file buffers.hpp.

References ana::detail::read_buffer_implementation::base(), and ana::detail::read_buffer_implementation::size_.

Here is the call graph for this function:

void ana::detail::read_buffer_implementation::resize ( size_t  new_size  )  [inline, inherited]

Resize the buffer, this won't affect the amount of memory usage.

It is only possible to downsize the buffer.

Precondition:
: The new size is smaller than the original size used to construct this.

Definition at line 69 of file buffers.hpp.

References ana::detail::read_buffer_implementation::size_.

size_t ana::detail::read_buffer_implementation::size (  )  const [inline, inherited]

Get the size of the buffer.

Definition at line 104 of file buffers.hpp.

References ana::detail::read_buffer_implementation::size_.

size_t ana::detail::copying_buffer::size (  )  const [inline, inherited]

Definition at line 148 of file buffers.hpp.

References ana::detail::copying_buffer::size_.

std::string ana::detail::read_buffer_implementation::string (  )  [inline, inherited]

Create a string from the buffer.

Definition at line 110 of file buffers.hpp.

References ana::detail::read_buffer_implementation::base_, and ana::detail::read_buffer_implementation::size_.

ana::detail::copying_buffer::~copying_buffer (  )  [inline, inherited]
ana::detail::read_buffer_implementation::~read_buffer_implementation (  )  [inline, inherited]

Deletes the buffer from heap.

Definition at line 78 of file buffers.hpp.

References ana::detail::read_buffer_implementation::base_.


Variable Documentation

void* ana::detail::copying_buffer::base_ [private, inherited]
const bool ana::detail::copying_buffer::copy_ [private, inherited]

Definition at line 163 of file buffers.hpp.

Referenced by ana::detail::copying_buffer::~copying_buffer().

const size_t ana::detail::copying_buffer::size_ [private, inherited]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:11:18 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs