Quick Links: |
#include <bslalg_containerbase.h>
Public Types | |
typedef ALLOCATOR | AllocatorType |
typedef void * | bslmaAllocatorPtr |
Public Member Functions | |
ContainerBase_NonBslmaBase (const ALLOCATOR &basicAllocator) | |
ContainerBase_NonBslmaBase (const ContainerBase_NonBslmaBase &rhs) | |
~ContainerBase_NonBslmaBase () | |
ALLOCATOR & | allocator () |
const ALLOCATOR & | allocator () const |
bslmaAllocatorPtr | bslmaAllocator () const |
One of two possible base classes for ContainerBase
. This class is for allocators that are not based on bslma::Allocator
. Provides access to the allocator.
Because this class inherits from ALLOCATOR
it can take advantage of empty-base optimization. In other words, if ALLOCATOR
has no state then it will not contribute to the footprint of the ContainerBase_NonBslmaBase
object. ContainerBase_NonBslmaBase
itself adds no state and will not increase the footprint of subsequently derived classes.
See Component bslalg_containerbase
typedef ALLOCATOR bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::AllocatorType |
typedef void* bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::bslmaAllocatorPtr |
bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::ContainerBase_NonBslmaBase | ( | const ALLOCATOR & | basicAllocator | ) |
Construct this object using the specified basicAllocator
or the parameterized ALLOCATOR
type.
bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::ContainerBase_NonBslmaBase | ( | const ContainerBase_NonBslmaBase< ALLOCATOR > & | rhs | ) |
Construct this object by copying the allocator from rhs. NOTE: Although this constructor does copy the allocator, the copy constructor in the bslma
-specific ContainerBase_BslmaBase
class (above) does not.
bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::~ContainerBase_NonBslmaBase | ( | ) |
Destroy this object.
ALLOCATOR& bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::allocator | ( | ) |
Return a reference to the modifiable allocator used to construct this object.
const ALLOCATOR& bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::allocator | ( | ) | const |
Return a reference to the non-modifiable allocator used to construct this object.
bslmaAllocatorPtr bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::bslmaAllocator | ( | ) | const |
Return a null pointer. (This container's allocator does not use bslma
). Note that the return type for this function differs from the (typedef'ed) return type for the same function in the ContainerBase_BslmaBase
class and can thus be used to choose one overloaded function over another.