BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslma::AllocatorAdaptor< STL_ALLOC > Class Template Reference

#include <bslma_allocatoradaptor.h>

Inheritance diagram for bslma::AllocatorAdaptor< STL_ALLOC >:
bslma::AllocatorAdaptor_Imp< STL_ALLOC::template rebind< char >::other > bslma::Allocator bsl::memory_resource

Detailed Description

template<class STL_ALLOC>
class bslma::AllocatorAdaptor< STL_ALLOC >

Polymorphic wrapper around an object of the specified STL_ALLOC STL-style allocator template parameter. A pointer to an object of this class can thus be used with any component that uses BDE-style memory allocation.

Note
Note that AllocatorAdaptor<A>::Type is the same type regardless of whether or not the compiler supports alias templates. It should be used, therefore, whenever the exact type of the adaptor is important.

Public Member Functions

 AllocatorAdaptor ()
 
 AllocatorAdaptor (const STL_ALLOC &stla)
 
 AllocatorAdaptor (const AllocatorAdaptor &)=default
 
 ~AllocatorAdaptor ()=default
 
- Public Member Functions inherited from bslma::AllocatorAdaptor_Imp< STL_ALLOC::template rebind< char >::other >
 AllocatorAdaptor_Imp ()
 
 AllocatorAdaptor_Imp (const StlAllocatorType &stla)
 
 ~AllocatorAdaptor_Imp () BSLS_KEYWORD_OVERRIDE
 
void * allocate (size_type size) BSLS_KEYWORD_OVERRIDE
 
void deallocate (void *address) BSLS_KEYWORD_OVERRIDE
 
STL_ALLOC adaptedAllocator () const
 
- Public Member Functions inherited from bslma::Allocator
 ~Allocator () BSLS_KEYWORD_OVERRIDE
 
template<class TYPE >
void deleteObject (const TYPE *object)
 
template<class TYPE >
void deleteObjectRaw (const TYPE *object)
 
void deleteObject (bsl::nullptr_t)
 
void deleteObjectRaw (bsl::nullptr_t)
 
- Public Member Functions inherited from bsl::memory_resource
 memory_resource () BSLS_KEYWORD_DEFAULT
 
 memory_resource (const memory_resource &) BSLS_KEYWORD_DEFAULT
 
virtual ~memory_resource ()
 
memory_resourceoperator= (const memory_resource &) BSLS_KEYWORD_DEFAULT
 
BSLA_NODISCARD void * allocate (size_t bytes, size_t alignment=k_MAX_ALIGN)
 
void deallocate (void *p, size_t bytes, size_t alignment=k_MAX_ALIGN)
 
bool is_equal (const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT
 

Additional Inherited Members

- Public Types inherited from bslma::AllocatorAdaptor_Imp< STL_ALLOC::template rebind< char >::other >
typedef AllocatorAdaptor_Imp Type
 
typedef STL_ALLOC StlAllocatorType
 
- Public Types inherited from bslma::Allocator
typedef std::size_t size_type
 
- Static Public Member Functions inherited from bslma::Allocator
static void throwBadAlloc ()
 
- Protected Member Functions inherited from bslma::Allocator
void * do_allocate (std::size_t bytes, std::size_t alignment) BSLS_KEYWORD_OVERRIDE
 
void do_deallocate (void *p, std::size_t bytes, std::size_t alignment) BSLS_KEYWORD_OVERRIDE
 
bool do_is_equal (const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT BSLS_KEYWORD_OVERRIDE
 

Constructor & Destructor Documentation

◆ AllocatorAdaptor()

template<class STL_ALLOC >
bslma::AllocatorAdaptor< STL_ALLOC >::AllocatorAdaptor ( const AllocatorAdaptor< STL_ALLOC > &  )
default

◆ ~AllocatorAdaptor()

template<class STL_ALLOC >
bslma::AllocatorAdaptor< STL_ALLOC >::~AllocatorAdaptor ( )
default

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