BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf::StdAllocatorAdaptor< ALLOCATOR > Class Template Reference

#include <bsltf_stdallocatoradaptor.h>

Inheritance diagram for bsltf::StdAllocatorAdaptor< ALLOCATOR >:

Classes

struct  rebind
 

Public Types

typedef ALLOCATOR::size_type size_type
 
typedef ALLOCATOR::difference_type difference_type
 
typedef ALLOCATOR::pointer pointer
 
typedef ALLOCATOR::const_pointer const_pointer
 
typedef ALLOCATOR::reference reference
 
typedef ALLOCATOR::const_reference const_reference
 
typedef ALLOCATOR::value_type value_type
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (StdAllocatorAdaptor, bslma::IsStdAllocator)
 
 StdAllocatorAdaptor ()
 
 StdAllocatorAdaptor (const ALLOCATOR &allocator)
 
 StdAllocatorAdaptor (bsl::nullptr_t)
 
template<class ANY_TYPE >
 StdAllocatorAdaptor (const StdAllocatorAdaptor< ANY_TYPE > &other)
 Create a copy of the specified other allocator adaptor.
 
 StdAllocatorAdaptor (const StdAllocatorAdaptor &original)=default
 
 ~StdAllocatorAdaptor ()=default
 
StdAllocatorAdaptoroperator= (const StdAllocatorAdaptor &rhs)=default
 
template<class ELEMENT_TYPE , class... Args>
void construct (ELEMENT_TYPE *address, Args &&... arguments)
 
const ALLOCATOR & allocator () const
 
StdAllocatorAdaptor< ALLOCATOR > select_on_container_copy_construction () const
 

Detailed Description

template<class ALLOCATOR>
class bsltf::StdAllocatorAdaptor< ALLOCATOR >

This class template provides the facade of an allocator but mostly delegates operations to the allocator object (of template parameter type) it adapts, except that it enables the propagation of the (stateful) allocator object to constructed elements, if appropriate.

See bsltf_stdallocatoradaptor

Member Typedef Documentation

◆ const_pointer

template<class ALLOCATOR >
typedef ALLOCATOR::const_pointer bsltf::StdAllocatorAdaptor< ALLOCATOR >::const_pointer

◆ const_reference

template<class ALLOCATOR >
typedef ALLOCATOR::const_reference bsltf::StdAllocatorAdaptor< ALLOCATOR >::const_reference

◆ difference_type

template<class ALLOCATOR >
typedef ALLOCATOR::difference_type bsltf::StdAllocatorAdaptor< ALLOCATOR >::difference_type

◆ pointer

template<class ALLOCATOR >
typedef ALLOCATOR::pointer bsltf::StdAllocatorAdaptor< ALLOCATOR >::pointer

◆ reference

template<class ALLOCATOR >
typedef ALLOCATOR::reference bsltf::StdAllocatorAdaptor< ALLOCATOR >::reference

◆ size_type

template<class ALLOCATOR >
typedef ALLOCATOR::size_type bsltf::StdAllocatorAdaptor< ALLOCATOR >::size_type

◆ value_type

template<class ALLOCATOR >
typedef ALLOCATOR::value_type bsltf::StdAllocatorAdaptor< ALLOCATOR >::value_type

Constructor & Destructor Documentation

◆ StdAllocatorAdaptor() [1/5]

template<class ALLOCATOR >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::StdAllocatorAdaptor ( )
inline

Create a standard allocator adaptor object for a default-constructed allocator object of the (template parameter) type ALLOCATOR.

◆ StdAllocatorAdaptor() [2/5]

template<class ALLOCATOR >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::StdAllocatorAdaptor ( const ALLOCATOR &  allocator)
inlineexplicit

Create a standard allocator adaptor object for the specified allocator of the (template parameter) type ALLOCATOR.

◆ StdAllocatorAdaptor() [3/5]

template<class ALLOCATOR >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::StdAllocatorAdaptor ( bsl::nullptr_t  )
inlineexplicit

Create a standard allocator adaptor object from the null pointer constant.

◆ StdAllocatorAdaptor() [4/5]

template<class ALLOCATOR >
template<class ANY_TYPE >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::StdAllocatorAdaptor ( const StdAllocatorAdaptor< ANY_TYPE > &  other)
inline

◆ StdAllocatorAdaptor() [5/5]

template<class ALLOCATOR >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::StdAllocatorAdaptor ( const StdAllocatorAdaptor< ALLOCATOR > &  original)
default

◆ ~StdAllocatorAdaptor()

template<class ALLOCATOR >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::~StdAllocatorAdaptor ( )
default

Member Function Documentation

◆ allocator()

template<class ALLOCATOR >
const ALLOCATOR & bsltf::StdAllocatorAdaptor< ALLOCATOR >::allocator ( ) const
inline

Return a reference to the non-modifiable allocator instance associated with this standard allocator adaptor.

◆ BSLMF_NESTED_TRAIT_DECLARATION()

template<class ALLOCATOR >
bsltf::StdAllocatorAdaptor< ALLOCATOR >::BSLMF_NESTED_TRAIT_DECLARATION ( StdAllocatorAdaptor< ALLOCATOR >  ,
bslma::IsStdAllocator   
)

◆ construct()

template<class ALLOCATOR >
template<class ELEMENT_TYPE , class... Args>
void bsltf::StdAllocatorAdaptor< ALLOCATOR >::construct ( ELEMENT_TYPE *  address,
Args &&...  arguments 
)
inline

Construct an object of the (template parameter) ELEMENT_TYPE, by forwarding the allocator instance associated with this allocator adaptor, if appropriate, and the specified (variable number of) arguments to the corresponding constructor of ELEMENT_TYPE, at the specified uninitialized memory address. The behavior is undefined unless address is properly aligned for objects of ELEMENT_TYPE.

◆ operator=()

template<class ALLOCATOR >
StdAllocatorAdaptor & bsltf::StdAllocatorAdaptor< ALLOCATOR >::operator= ( const StdAllocatorAdaptor< ALLOCATOR > &  rhs)
default

◆ select_on_container_copy_construction()

template<class ALLOCATOR >
StdAllocatorAdaptor< ALLOCATOR > bsltf::StdAllocatorAdaptor< ALLOCATOR >::select_on_container_copy_construction ( ) const
inline

Return an allocator adaptor for the allocator object returned by the select_on_container_copy_construction class method in the allocator_traits class template for the allocator object, of the (template parameter) type ALLOCATOR, associated with this adaptor. The allocator_traits class template presumably delegates this call to the allocator object if such an operation is supported by the ALLOCATOR type, or provides a suitable default behavior if such an operation is not supported.


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