Quick Links: |
#include <bslalg_containerbase.h>
Public Types | |
typedef ALLOCATOR | AllocatorType |
typedef bslma::Allocator * | bslmaAllocatorPtr |
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 |
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
typedef ALLOCATOR bslalg::ContainerBase_BslmaBase< ALLOCATOR >::AllocatorType |
typedef bslma::Allocator* bslalg::ContainerBase_BslmaBase< ALLOCATOR >::bslmaAllocatorPtr |
bslalg::ContainerBase_BslmaBase< ALLOCATOR >::ContainerBase_BslmaBase | ( | const ALLOCATOR & | basicAllocator | ) | [explicit] |
Construct this object using the specified basicAllocator
of the ALLOCATOR
parameterized type.
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.
bslalg::ContainerBase_BslmaBase< ALLOCATOR >::~ContainerBase_BslmaBase | ( | ) |
Destroy this object.
ALLOCATOR& bslalg::ContainerBase_BslmaBase< ALLOCATOR >::allocator | ( | ) |
Return a reference to the modifiable allocator used to construct this object.
const ALLOCATOR& bslalg::ContainerBase_BslmaBase< ALLOCATOR >::allocator | ( | ) | const |
Return a reference to the non-modifiable allocator used to construct this object.
bslmaAllocatorPtr bslalg::ContainerBase_BslmaBase< ALLOCATOR >::bslmaAllocator | ( | ) | const |
Return allocator().mechanism()
.