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

#include <consuming_buffers.hpp>

Classes

class  const_iterator
 

Public Types

using value_type = typename std::conditional< std::is_convertible< typename std::iterator_traits< iter_type >::value_type, boost::asio::mutable_buffer >::value, boost::asio::mutable_buffer, boost::asio::const_buffer >::type
 

Public Member Functions

 consuming_buffers ()
 Constructor. More...
 
 consuming_buffers (consuming_buffers &&)
 Constructor. More...
 
 consuming_buffers (consuming_buffers const &)
 Constructor. More...
 
 consuming_buffers (BufferSequence const &buffers)
 
template<class... Args>
 consuming_buffers (boost::in_place_init_t, Args &&...args)
 
consuming_buffersoperator= (consuming_buffers &&)
 Assignment. More...
 
consuming_buffersoperator= (consuming_buffers const &)
 Assignment. More...
 
BufferSequence const & get () const
 Returns the underlying buffers, without modification. More...
 
const_iterator begin () const
 Get a bidirectional iterator to the first element. More...
 
const_iterator end () const
 Get a bidirectional iterator to one past the last element. More...
 
void consume (std::size_t amount)
 

Detailed Description

template<class BufferSequence>
class boost::beast::consuming_buffers< BufferSequence >

Adapter to trim the front of a BufferSequence.

This adapter wraps a buffer sequence to create a new sequence which may be incrementally consumed. Bytes consumed are removed from the front of the buffer. The underlying memory is not changed, instead the adapter efficiently iterates through a subset of the buffers wrapped.

The wrapped buffer is not modified, a copy is made instead. Ownership of the underlying memory is not transferred, the application is still responsible for managing its lifetime.

Template Parameters
BufferSequenceThe buffer sequence to wrap.

Member Typedef Documentation

template<class BufferSequence>
using boost::beast::consuming_buffers< BufferSequence >::value_type = typename std::conditional< std::is_convertible<typename std::iterator_traits<iter_type>::value_type, boost::asio::mutable_buffer>::value, boost::asio::mutable_buffer, boost::asio::const_buffer>::type

The type for each element in the list of buffers.

If the buffers in the underlying sequence are convertible to boost::asio::mutable_buffer, then this type will be boost::asio::mutable_buffer, else this type will be boost::asio::const_buffer.

Constructor & Destructor Documentation

template<class Buffers >
boost::beast::consuming_buffers< Buffers >::consuming_buffers ( )

Constructor.

template<class Buffers >
boost::beast::consuming_buffers< Buffers >::consuming_buffers ( consuming_buffers< BufferSequence > &&  other)

Constructor.

template<class Buffers >
boost::beast::consuming_buffers< Buffers >::consuming_buffers ( consuming_buffers< BufferSequence > const &  other)

Constructor.

template<class Buffers>
boost::beast::consuming_buffers< Buffers >::consuming_buffers ( Buffers const &  buffers)
explicit

Constructor

A copy of the buffer sequence is made. Ownership of the underlying memory is not transferred or copied.

template<class Buffers >
template<class... Args>
boost::beast::consuming_buffers< Buffers >::consuming_buffers ( boost::in_place_init_t  ,
Args &&...  args 
)

Constructor

This constructs the buffer sequence in-place from a list of arguments.

Parameters
argsArguments forwarded to the buffers constructor.

Member Function Documentation

template<class Buffers >
auto boost::beast::consuming_buffers< Buffers >::begin ( ) const
inline

Get a bidirectional iterator to the first element.

template<class Buffers >
void boost::beast::consuming_buffers< Buffers >::consume ( std::size_t  amount)

Remove bytes from the beginning of the sequence.

Parameters
amountThe number of bytes to remove. If this is larger than the number of bytes remaining, all the bytes remaining are removed.
template<class Buffers >
auto boost::beast::consuming_buffers< Buffers >::end ( ) const
inline

Get a bidirectional iterator to one past the last element.

template<class BufferSequence>
BufferSequence const& boost::beast::consuming_buffers< BufferSequence >::get ( ) const
inline

Returns the underlying buffers, without modification.

template<class Buffers >
auto boost::beast::consuming_buffers< Buffers >::operator= ( consuming_buffers< BufferSequence > &&  other)

Assignment.

template<class Buffers >
auto boost::beast::consuming_buffers< Buffers >::operator= ( consuming_buffers< BufferSequence > const &  other)

Assignment.


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