ゴミ箱
Classes | Public Types | Public Member Functions | Friends | List of all members
boost::beast::handler_alloc< T, Handler > Class Template Reference

#include <handler_alloc.hpp>

Classes

struct  rebind
 

Public Types

using value_type = T
 
using is_always_equal = std::true_type
 
using pointer = T *
 
using reference = T &
 
using const_pointer = T const *
 
using const_reference = T const &
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 

Public Member Functions

 handler_alloc ()=delete
 
 handler_alloc (handler_alloc &&)=default
 
 handler_alloc (handler_alloc const &)=default
 
handler_allocoperator= (handler_alloc &&)=default
 
handler_allocoperator= (handler_alloc const &)=default
 
 handler_alloc (Handler &h)
 
template<class U >
 handler_alloc (handler_alloc< U, Handler > const &other)
 Copy constructor. More...
 
value_typeallocate (size_type n)
 
void deallocate (value_type *p, size_type n)
 

Friends

template<class U , class H >
class handler_alloc
 
template<class U >
bool operator== (handler_alloc const &, handler_alloc< U, Handler > const &)
 
template<class U >
bool operator!= (handler_alloc const &lhs, handler_alloc< U, Handler > const &rhs)
 

Detailed Description

template<class T, class Handler>
class boost::beast::handler_alloc< T, Handler >

An allocator that uses handler customizations.

This allocator uses the handler customizations asio_handler_allocate and asio_handler_deallocate to manage memory. It meets the requirements of Allocator and can be used anywhere a std::allocator is accepted.

Template Parameters
TThe type of objects allocated by the allocator.
HandlerThe type of handler.
Note
Memory allocated by this allocator must be freed before the handler is invoked or undefined behavior results. This behavior is described as the "deallocate before invocation" Asio guarantee.

Member Typedef Documentation

template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::const_pointer = T const*
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::const_reference = T const&
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::difference_type = std::ptrdiff_t
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::is_always_equal = std::true_type
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::pointer = T*
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::reference = T&
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::size_type = std::size_t
template<class T, class Handler>
using boost::beast::handler_alloc< T, Handler >::value_type = T

Constructor & Destructor Documentation

template<class T, class Handler>
boost::beast::handler_alloc< T, Handler >::handler_alloc ( )
delete
template<class T, class Handler>
boost::beast::handler_alloc< T, Handler >::handler_alloc ( handler_alloc< T, Handler > &&  )
default
template<class T, class Handler>
boost::beast::handler_alloc< T, Handler >::handler_alloc ( handler_alloc< T, Handler > const &  )
default
template<class T, class Handler>
boost::beast::handler_alloc< T, Handler >::handler_alloc ( Handler &  h)
inlineexplicit

Construct the allocator.

A reference of the handler is stored. The handler must remain valid for at least the lifetime of the allocator.

template<class T, class Handler>
template<class U >
boost::beast::handler_alloc< T, Handler >::handler_alloc ( handler_alloc< U, Handler > const &  other)
inline

Copy constructor.

Member Function Documentation

template<class T, class Handler>
value_type* boost::beast::handler_alloc< T, Handler >::allocate ( size_type  n)
inline
template<class T, class Handler>
void boost::beast::handler_alloc< T, Handler >::deallocate ( value_type p,
size_type  n 
)
inline
template<class T, class Handler>
handler_alloc& boost::beast::handler_alloc< T, Handler >::operator= ( handler_alloc< T, Handler > &&  )
default
template<class T, class Handler>
handler_alloc& boost::beast::handler_alloc< T, Handler >::operator= ( handler_alloc< T, Handler > const &  )
default

Friends And Related Function Documentation

template<class T, class Handler>
template<class U , class H >
friend class handler_alloc
friend
template<class T, class Handler>
template<class U >
bool operator!= ( handler_alloc< T, Handler > const &  lhs,
handler_alloc< U, Handler > const &  rhs 
)
friend
template<class T, class Handler>
template<class U >
bool operator== ( handler_alloc< T, Handler > const &  ,
handler_alloc< U, Handler > const &   
)
friend

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