CppServer  1.0.4.0
C++ Server Library
Public Types | Public Member Functions | List of all members
CppServer::Asio::AllocateHandler< THandler > Class Template Reference

Asio allocate handler wrapper. More...

#include <memory.h>

Public Types

typedef HandlerAllocator< THandler > allocator_type
 Allocator type. More...
 

Public Member Functions

 AllocateHandler (HandlerStorage &storage, THandler handler) noexcept
 Initialize allocate handler wrapper with a given memory storage and handler. More...
 
 AllocateHandler (const AllocateHandler &) noexcept=default
 
 AllocateHandler (AllocateHandler &&) noexcept=default
 
 ~AllocateHandler () noexcept=default
 
AllocateHandleroperator= (const AllocateHandler &) noexcept=default
 
AllocateHandleroperator= (AllocateHandler &&) noexcept=default
 
allocator_type get_allocator () const noexcept
 Get the handler allocator. More...
 
template<typename ... Args>
void operator() (Args &&... args)
 Wrap the handler. More...
 

Detailed Description

template<typename THandler>
class CppServer::Asio::AllocateHandler< THandler >

Asio allocate handler wrapper.

Wrapper class template for handler objects to allow handler memory allocation to be customised. The allocator_type type and get_allocator() member function are used by the asynchronous operations to obtain the allocator. Calls to operator() are forwarded to the encapsulated handler.

Not thread-safe.

Definition at line 132 of file memory.h.

Member Typedef Documentation

◆ allocator_type

template<typename THandler >
typedef HandlerAllocator<THandler> CppServer::Asio::AllocateHandler< THandler >::allocator_type

Allocator type.

Definition at line 136 of file memory.h.

Constructor & Destructor Documentation

◆ AllocateHandler() [1/3]

template<typename THandler >
CppServer::Asio::AllocateHandler< THandler >::AllocateHandler ( HandlerStorage storage,
THandler  handler 
)
inlinenoexcept

Initialize allocate handler wrapper with a given memory storage and handler.

Parameters
storage- Memory storage
handler- Handler to allocate

Definition at line 143 of file memory.h.

◆ AllocateHandler() [2/3]

template<typename THandler >
CppServer::Asio::AllocateHandler< THandler >::AllocateHandler ( const AllocateHandler< THandler > &  )
defaultnoexcept

◆ AllocateHandler() [3/3]

template<typename THandler >
CppServer::Asio::AllocateHandler< THandler >::AllocateHandler ( AllocateHandler< THandler > &&  )
defaultnoexcept

◆ ~AllocateHandler()

template<typename THandler >
CppServer::Asio::AllocateHandler< THandler >::~AllocateHandler ( )
defaultnoexcept

Member Function Documentation

◆ get_allocator()

template<typename THandler >
allocator_type CppServer::Asio::AllocateHandler< THandler >::get_allocator ( ) const
inlinenoexcept

Get the handler allocator.

Definition at line 152 of file memory.h.

◆ operator()()

template<typename THandler >
template<typename ... Args>
void CppServer::Asio::AllocateHandler< THandler >::operator() ( Args &&...  args)
inline

Wrap the handler.

Definition at line 156 of file memory.h.

◆ operator=() [1/2]

template<typename THandler >
AllocateHandler& CppServer::Asio::AllocateHandler< THandler >::operator= ( AllocateHandler< THandler > &&  )
defaultnoexcept

◆ operator=() [2/2]

template<typename THandler >
AllocateHandler& CppServer::Asio::AllocateHandler< THandler >::operator= ( const AllocateHandler< THandler > &  )
defaultnoexcept

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