Sources Pipelines Documentation

Allocators  
Public Member Functions | List of all members
boost::memory::buffer_ref Class Reference

A non-owning reference to a buffer. More...

#include <buffer_ref.hpp>

Public Member Functions

template<typename pointer_type >
 buffer_ref (pointer_type *data, size_t length)
 Creates a reference through a pointer and length. More...
 
template<typename pointer_type >
 buffer_ref (const pointer_type *data, size_t length)
 Creates a reference through const pointer and length. More...
 
template<typename pointer_type >
 buffer_ref (pointer_type *pointer)
 Creates a buffer reference from a type pointer. More...
 
 buffer_ref (const memory_block &block)
 Creates a buffer reference from a memory block definition. More...
 
 buffer_ref (const std::string &s)
 Creates a buffer reference for a string. More...
 
template<typename reference_type >
reference_type as ()
 Obtains a reference to the underlying memory block treating it as the given reference_type. More...
 
template<typename pointer_type >
pointer_type as_pointer ()
 Obtains a reference to the underlying memory block treating it as a representation of the given pointer_type. More...
 
size_t length () const
 Number of bytes in the buffer.
 
buffer_ref subbuf (size_t length) const
 Obtains a sub buffer with the given size. More...
 

Detailed Description

A non-owning reference to a buffer.

A buffer reference provides a range of utilities for describing a buffer - like pointer to memory block where the buffer data resides and length of the data. Additionally methods for accessing the data from the buffer are provided.

Definition at line 18 of file buffer_ref.hpp.

Constructor & Destructor Documentation

template<typename pointer_type >
boost::memory::buffer_ref::buffer_ref ( pointer_type *  data,
size_t  length 
)
inline

Creates a reference through a pointer and length.

Parameters
dataA pointer to memory location.
lengthNumber of bytes in the buffer.

Definition at line 9 of file buffer_ref.ipp.

Referenced by subbuf().

template<typename pointer_type >
boost::memory::buffer_ref::buffer_ref ( const pointer_type *  data,
size_t  length 
)
inline

Creates a reference through const pointer and length.

Parameters
dataA pointer to memory block.
lengthLength of the block.

Definition at line 20 of file buffer_ref.ipp.

template<typename pointer_type >
boost::memory::buffer_ref::buffer_ref ( pointer_type *  pointer)
inline

Creates a buffer reference from a type pointer.

Creates buffer holds a pointer given in the constructor and length of the type passed in the constructor.

Parameters
pointerA pointer to a type.

Definition at line 31 of file buffer_ref.ipp.

boost::memory::buffer_ref::buffer_ref ( const memory_block block)
inline

Creates a buffer reference from a memory block definition.

Parameters
referenceA memory_block the buffer is pointing at.

Definition at line 39 of file buffer_ref.ipp.

boost::memory::buffer_ref::buffer_ref ( const std::string &  s)
inline

Creates a buffer reference for a string.

Parameters
sA string to get the buffer definition from.

Definition at line 47 of file buffer_ref.ipp.

Member Function Documentation

template<typename reference_type >
reference_type boost::memory::buffer_ref::as ( )
inline

Obtains a reference to the underlying memory block treating it as the given reference_type.

Returns
A reference to the underlying type instance.

Definition at line 56 of file buffer_ref.ipp.

template<typename pointer_type >
pointer_type boost::memory::buffer_ref::as_pointer ( )
inline

Obtains a reference to the underlying memory block treating it as a representation of the given pointer_type.

Returns
A pointer to the underlying entity.

Definition at line 67 of file buffer_ref.ipp.

buffer_ref boost::memory::buffer_ref::subbuf ( size_t  length) const
inline

Obtains a sub buffer with the given size.

Parameters
lengthThe size of sub buffer.
Returns
A sub buffer definition.

Definition at line 79 of file buffer_ref.ipp.


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