Quick Links:

bal | bbl | bdl | bsl

Classes | Public Types | Public Member Functions

bsltf::StdAllocatorAdaptor< ALLOCATOR > Class Template Reference

#include <bsltf_stdallocatoradaptor.h>

List of all members.

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

 StdAllocatorAdaptor ()
 StdAllocatorAdaptor (const ALLOCATOR &allocator)
template<class ANY_TYPE >
 StdAllocatorAdaptor (const StdAllocatorAdaptor< ANY_TYPE > &other)
 StdAllocatorAdaptor (const StdAllocatorAdaptor &original)
 ~StdAllocatorAdaptor ()
StdAllocatorAdaptoroperator= (const StdAllocatorAdaptor &rhs)
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 Component bsltf_stdallocatoradaptor


Member Typedef Documentation

template<class ALLOCATOR>
typedef ALLOCATOR::size_type bsltf::StdAllocatorAdaptor< ALLOCATOR >::size_type
template<class ALLOCATOR>
typedef ALLOCATOR::difference_type bsltf::StdAllocatorAdaptor< ALLOCATOR >::difference_type
template<class ALLOCATOR>
typedef ALLOCATOR::pointer bsltf::StdAllocatorAdaptor< ALLOCATOR >::pointer
template<class ALLOCATOR>
typedef ALLOCATOR::const_pointer bsltf::StdAllocatorAdaptor< ALLOCATOR >::const_pointer
template<class ALLOCATOR>
typedef ALLOCATOR::reference bsltf::StdAllocatorAdaptor< ALLOCATOR >::reference
template<class ALLOCATOR>
typedef ALLOCATOR::const_reference bsltf::StdAllocatorAdaptor< ALLOCATOR >::const_reference
template<class ALLOCATOR>
typedef ALLOCATOR::value_type bsltf::StdAllocatorAdaptor< ALLOCATOR >::value_type

Constructor & Destructor Documentation

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

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

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

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

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

Create a copy of the specified other allocator adaptor.

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

Destroy this object.


Member Function Documentation

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

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.

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

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

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

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: