Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions

bslalg::ContainerBase_BslmaBase< ALLOCATOR > Class Template Reference

#include <bslalg_containerbase.h>

List of all members.

Public Types

typedef ALLOCATOR AllocatorType
typedef bslma::AllocatorbslmaAllocatorPtr

Public Member Functions

 ContainerBase_BslmaBase (const ALLOCATOR &basicAllocator)
 ContainerBase_BslmaBase (const ContainerBase_BslmaBase &original)
 ~ContainerBase_BslmaBase ()
ALLOCATOR & allocator ()
const ALLOCATOR & allocator () const
bslmaAllocatorPtr bslmaAllocator () const

Detailed Description

template<class ALLOCATOR>
class bslalg::ContainerBase_BslmaBase< ALLOCATOR >

One of two possible base classes for ContainerBase. This class should only be used for allocators that are based on bslma::Allocator. Provides access to the allocator. Since ALLOCATOR always has state (at least a bslma::Allocator *), there is no empty-base initialization opportunity, so we don't inherit from ALLOCATOR the way ContainerBase_NonBslmaBase does, below. (Inheritance of this type can cause ambiguous conversions and should be avoided or insulated.)

See Component bslalg_containerbase


Member Typedef Documentation

template<class ALLOCATOR >
typedef ALLOCATOR bslalg::ContainerBase_BslmaBase< ALLOCATOR >::AllocatorType
template<class ALLOCATOR >
typedef bslma::Allocator* bslalg::ContainerBase_BslmaBase< ALLOCATOR >::bslmaAllocatorPtr

Constructor & Destructor Documentation

template<class ALLOCATOR >
bslalg::ContainerBase_BslmaBase< ALLOCATOR >::ContainerBase_BslmaBase ( const ALLOCATOR &  basicAllocator  )  [explicit]

Construct this object using the specified basicAllocator of the ALLOCATOR parameterized type.

template<class ALLOCATOR >
bslalg::ContainerBase_BslmaBase< ALLOCATOR >::ContainerBase_BslmaBase ( const ContainerBase_BslmaBase< ALLOCATOR > &  original  ) 

Construct this object using the default allocator. The original argument is ignored. NOTE: This is obviously not a copy constructor as is does not do any copying. It does implement BSL-style allocator semantics, whereby a newly created object must either have an explicitly-specified allocator or else it uses the default allocator object. Under no circumstances is a BSL-style allocator copied during copy construction or assignment.

template<class ALLOCATOR >
bslalg::ContainerBase_BslmaBase< ALLOCATOR >::~ContainerBase_BslmaBase (  ) 

Destroy this object.


Member Function Documentation

template<class ALLOCATOR >
ALLOCATOR& bslalg::ContainerBase_BslmaBase< ALLOCATOR >::allocator (  ) 

Return a reference to the modifiable allocator used to construct this object.

template<class ALLOCATOR >
const ALLOCATOR& bslalg::ContainerBase_BslmaBase< ALLOCATOR >::allocator (  )  const

Return a reference to the non-modifiable allocator used to construct this object.

template<class ALLOCATOR >
bslmaAllocatorPtr bslalg::ContainerBase_BslmaBase< ALLOCATOR >::bslmaAllocator (  )  const

Return allocator().mechanism().


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