Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions

bslalg::ContainerBase_NonBslmaBase< ALLOCATOR > Class Template Reference

#include <bslalg_containerbase.h>

List of all members.

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

Detailed Description

template<class ALLOCATOR>
class bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >

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


Member Typedef Documentation

template<class ALLOCATOR >
typedef ALLOCATOR bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::AllocatorType
template<class ALLOCATOR >
typedef void* bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::bslmaAllocatorPtr

Constructor & Destructor Documentation

template<class ALLOCATOR >
bslalg::ContainerBase_NonBslmaBase< ALLOCATOR >::ContainerBase_NonBslmaBase ( const ALLOCATOR &  basicAllocator  ) 

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

template<class ALLOCATOR >
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.

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

Destroy this object.


Member Function Documentation

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

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

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

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

template<class ALLOCATOR >
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.


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