ゴミ箱
Classes | Public Member Functions | List of all members
boost::beast::buffers_adapter< MutableBufferSequence > Class Template Reference

#include <buffers_adapter.hpp>

Classes

class   const_buffers_type
 
class  mutable_buffers_type
 

Public Member Functions

 buffers_adapter (buffers_adapter &&other)
 Move constructor. More...
 
 buffers_adapter (buffers_adapter const &other)
 Copy constructor. More...
 
buffers_adapteroperator= (buffers_adapter &&other)
 Move assignment. More...
 
buffers_adapteroperator= (buffers_adapter const &)
 Copy assignment. More...
 
 buffers_adapter (MutableBufferSequence const &buffers)
 
std::size_t max_size () const
 Returns the largest size output sequence possible. More...
 
std::size_t size () const
 Get the size of the input sequence. More...
 
std::size_t capacity () const
 Returns the maximum sum of the sizes of the input sequence and output sequence the buffer can hold without requiring reallocation. More...
 
mutable_buffers_type prepare (std::size_t n)
 
void commit (std::size_t n)
 
const_buffers_type data () const
 
void consume (std::size_t n)
 Remove bytes from the input sequence. More...
 

Detailed Description

template<class MutableBufferSequence>
class boost::beast::buffers_adapter< MutableBufferSequence >

Adapts a MutableBufferSequence into a DynamicBuffer.

This class wraps a MutableBufferSequence to meet the requirements of DynamicBuffer. Upon construction the input and output sequences are empty. A copy of the mutable buffer sequence object is stored; however, ownership of the underlying memory is not transferred. The caller is responsible for making sure that referenced memory remains valid for the duration of any operations.

The size of the mutable buffer sequence determines the maximum number of bytes which may be prepared and committed.

Template Parameters
MutableBufferSequenceThe type of mutable buffer sequence to wrap.

Constructor & Destructor Documentation

template<class MutableBufferSequence >
boost::beast::buffers_adapter< MutableBufferSequence >::buffers_adapter ( buffers_adapter< MutableBufferSequence > &&  other)

Move constructor.

template<class MutableBufferSequence >
boost::beast::buffers_adapter< MutableBufferSequence >::buffers_adapter ( buffers_adapter< MutableBufferSequence > const &  other)

Copy constructor.

template<class MutableBufferSequence >
boost::beast::buffers_adapter< MutableBufferSequence >::buffers_adapter ( MutableBufferSequence const &  buffers)
explicit

Construct a buffers adapter.

Parameters
buffersThe mutable buffer sequence to wrap. A copy of the object will be made, but ownership of the memory is not transferred.

Member Function Documentation

template<class MutableBufferSequence >
std::size_t boost::beast::buffers_adapter< MutableBufferSequence >::capacity ( ) const
inline

Returns the maximum sum of the sizes of the input sequence and output sequence the buffer can hold without requiring reallocation.

template<class MutableBufferSequence >
void boost::beast::buffers_adapter< MutableBufferSequence >::commit ( std::size_t  n)

Move bytes from the output sequence to the input sequence.

Note
Buffers representing the input sequence acquired prior to this call remain valid.
template<class MutableBufferSequence >
void boost::beast::buffers_adapter< MutableBufferSequence >::consume ( std::size_t  n)

Remove bytes from the input sequence.

template<class MutableBufferSequence >
auto boost::beast::buffers_adapter< MutableBufferSequence >::data ( ) const
inline

Get a list of buffers that represents the input sequence.

Note
These buffers remain valid across subsequent calls to prepare.
template<class MutableBufferSequence >
std::size_t boost::beast::buffers_adapter< MutableBufferSequence >::max_size ( ) const
inline

Returns the largest size output sequence possible.

template<class MutableBufferSequence >
auto boost::beast::buffers_adapter< MutableBufferSequence >::operator= ( buffers_adapter< MutableBufferSequence > &&  other)

Move assignment.

template<class MutableBufferSequence >
auto boost::beast::buffers_adapter< MutableBufferSequence >::operator= ( buffers_adapter< MutableBufferSequence > const &  other)

Copy assignment.

template<class MutableBufferSequence >
auto boost::beast::buffers_adapter< MutableBufferSequence >::prepare ( std::size_t  n)

Get a list of buffers that represents the output sequence, with the given size.

Exceptions
std::length_errorif the size would exceed the limit imposed by the underlying mutable buffer sequence.
Note
Buffers representing the input sequence acquired prior to this call remain valid.
template<class MutableBufferSequence >
std::size_t boost::beast::buffers_adapter< MutableBufferSequence >::size ( ) const
inline

Get the size of the input sequence.


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