CppServer 1.0.6.0
C++ Server Library
Loading...
Searching...
No Matches
CppServer::Asio::HandlerAllocator< T > Class Template Reference

Asio handler allocator. More...

#include <memory.h>

Public Types

typedef T value_type
 Element type.
typedef T * pointer
 Pointer to element.
typedef T & reference
 Reference to element.
typedef const T * const_pointer
 Pointer to constant element.
typedef const T & const_reference
 Reference to constant element.
typedef size_t size_type
 Quantities of elements.
typedef ptrdiff_t difference_type
 Difference between two pointers.

Public Member Functions

 HandlerAllocator (HandlerStorage &storage) noexcept
 Initialize allocator with a given memory storage.
template<typename U>
 HandlerAllocator (const HandlerAllocator< U > &alloc) noexcept
 HandlerAllocator (const HandlerAllocator &alloc) noexcept
 HandlerAllocator (HandlerAllocator &&) noexcept=default
 ~HandlerAllocator () noexcept=default
template<typename U>
HandlerAllocatoroperator= (const HandlerAllocator< U > &alloc) noexcept
HandlerAllocatoroperator= (const HandlerAllocator &alloc) noexcept
HandlerAllocatoroperator= (HandlerAllocator &&) noexcept=default
pointer allocate (size_type num, const void *hint=0)
 Allocate a block of storage suitable to contain the given count of elements.
void deallocate (pointer ptr, size_type num)
 Release a block of storage previously allocated.

Friends

template<typename>
class HandlerAllocator

Detailed Description

template<typename T>
class CppServer::Asio::HandlerAllocator< T >

Asio handler allocator.

The allocator to be associated with the handler objects. This allocator only needs to satisfy the C++11 minimal allocator requirements.

Not thread-safe.

Definition at line 64 of file memory.h.

Member Typedef Documentation

◆ const_pointer

template<typename T>
typedef const T* CppServer::Asio::HandlerAllocator< T >::const_pointer

Pointer to constant element.

Definition at line 77 of file memory.h.

◆ const_reference

template<typename T>
typedef const T& CppServer::Asio::HandlerAllocator< T >::const_reference

Reference to constant element.

Definition at line 79 of file memory.h.

◆ difference_type

template<typename T>
typedef ptrdiff_t CppServer::Asio::HandlerAllocator< T >::difference_type

Difference between two pointers.

Definition at line 83 of file memory.h.

◆ pointer

template<typename T>
typedef T* CppServer::Asio::HandlerAllocator< T >::pointer

Pointer to element.

Definition at line 73 of file memory.h.

◆ reference

template<typename T>
typedef T& CppServer::Asio::HandlerAllocator< T >::reference

Reference to element.

Definition at line 75 of file memory.h.

◆ size_type

template<typename T>
typedef size_t CppServer::Asio::HandlerAllocator< T >::size_type

Quantities of elements.

Definition at line 81 of file memory.h.

◆ value_type

template<typename T>
typedef T CppServer::Asio::HandlerAllocator< T >::value_type

Element type.

Definition at line 71 of file memory.h.

Constructor & Destructor Documentation

◆ HandlerAllocator() [1/4]

template<typename T>
CppServer::Asio::HandlerAllocator< T >::HandlerAllocator ( HandlerStorage & storage)
inlineexplicitnoexcept

Initialize allocator with a given memory storage.

Parameters
storage- Memory storage

Definition at line 89 of file memory.h.

◆ HandlerAllocator() [2/4]

template<typename T>
template<typename U>
CppServer::Asio::HandlerAllocator< T >::HandlerAllocator ( const HandlerAllocator< U > & alloc)
inlinenoexcept

Definition at line 91 of file memory.h.

◆ HandlerAllocator() [3/4]

template<typename T>
CppServer::Asio::HandlerAllocator< T >::HandlerAllocator ( const HandlerAllocator< T > & alloc)
inlinenoexcept

Definition at line 92 of file memory.h.

◆ HandlerAllocator() [4/4]

template<typename T>
CppServer::Asio::HandlerAllocator< T >::HandlerAllocator ( HandlerAllocator< T > && )
defaultnoexcept

◆ ~HandlerAllocator()

template<typename T>
CppServer::Asio::HandlerAllocator< T >::~HandlerAllocator ( )
defaultnoexcept

Member Function Documentation

◆ allocate()

template<typename T>
pointer CppServer::Asio::HandlerAllocator< T >::allocate ( size_type num,
const void * hint = 0 )
inline

Allocate a block of storage suitable to contain the given count of elements.

Parameters
num- Number of elements to be allocated
hint- Allocation hint (default is 0)
Returns
A pointer to the initial element in the block of storage

Definition at line 109 of file memory.h.

◆ deallocate()

template<typename T>
void CppServer::Asio::HandlerAllocator< T >::deallocate ( pointer ptr,
size_type num )
inline

Release a block of storage previously allocated.

Parameters
ptr- Pointer to a block of storage
num- Number of releasing elements

Definition at line 115 of file memory.h.

◆ operator=() [1/3]

template<typename T>
HandlerAllocator & CppServer::Asio::HandlerAllocator< T >::operator= ( const HandlerAllocator< T > & alloc)
inlinenoexcept

Definition at line 99 of file memory.h.

◆ operator=() [2/3]

template<typename T>
template<typename U>
HandlerAllocator & CppServer::Asio::HandlerAllocator< T >::operator= ( const HandlerAllocator< U > & alloc)
inlinenoexcept

Definition at line 97 of file memory.h.

◆ operator=() [3/3]

template<typename T>
HandlerAllocator & CppServer::Asio::HandlerAllocator< T >::operator= ( HandlerAllocator< T > && )
defaultnoexcept

◆ HandlerAllocator

template<typename T>
template<typename>
friend class HandlerAllocator
friend

Definition at line 67 of file memory.h.


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