|
BDE 4.39.x Production Release
|
#include <bsltf_stdtestallocator.h>
This allocator implements the minimal interface to comply with section 20.1.5 ([lib.allocator.requirements]) of the C++03 standard. Instances of this allocator delegate their operations to a globally configured delegate allocator as C++03 compliant allocators cannot have individually identifiable state (see StdTestAllocatorConfiguration and 'StdTestAllocatorConfigurationGuard).
Classes | |
| struct | rebind |
Public Types | |
| typedef bsls::Types::UintPtr | size_type |
| typedef bsls::Types::IntPtr | difference_type |
| typedef TYPE * | pointer |
| typedef const TYPE * | const_pointer |
| typedef TYPE & | reference |
| typedef const TYPE & | const_reference |
| typedef TYPE | value_type |
Public Member Functions | |
| BSLMF_NESTED_TRAIT_DECLARATION (StdTestAllocator, bslma::IsStdAllocator) | |
| StdTestAllocator () | |
| template<class BDE_OTHER_TYPE > | |
| StdTestAllocator (const StdTestAllocator< BDE_OTHER_TYPE > &) | |
| pointer | allocate (size_type numElements) |
| void | deallocate (pointer address, size_type numElements=1) |
| template<class ELEMENT_TYPE , class... Args> | |
| void | construct (ELEMENT_TYPE *address, Args &&... arguments) |
| template<class ELEMENT_TYPE > | |
| void | destroy (ELEMENT_TYPE *address) |
| pointer | address (reference object) const |
| const_pointer | address (const_reference object) const |
| size_type | max_size () const |
| typedef const TYPE* bsltf::StdTestAllocator< TYPE >::const_pointer |
| typedef const TYPE& bsltf::StdTestAllocator< TYPE >::const_reference |
| typedef bsls::Types::IntPtr bsltf::StdTestAllocator< TYPE >::difference_type |
| typedef TYPE* bsltf::StdTestAllocator< TYPE >::pointer |
| typedef TYPE& bsltf::StdTestAllocator< TYPE >::reference |
| typedef bsls::Types::UintPtr bsltf::StdTestAllocator< TYPE >::size_type |
| typedef TYPE bsltf::StdTestAllocator< TYPE >::value_type |
|
inline |
Create a StdTestAllocator object.
| bsltf::StdTestAllocator< TYPE >::StdTestAllocator | ( | const StdTestAllocator< BDE_OTHER_TYPE > & | ) |
Create a StdTestAllocator object.
|
inline |
Return the address providing non-modifiable access to object.
|
inline |
Return the address providing modifiable access to object.
| pointer bsltf::StdTestAllocator< TYPE >::allocate | ( | size_type | numElements | ) |
Allocate enough (properly aligned) space for the specified numElements of type T. If the configured delegate allocator is unable to fulfill the allocation request, an exception (typically bsl::bad_alloc) will be thrown.
numElements <= max_size(). | bsltf::StdTestAllocator< TYPE >::BSLMF_NESTED_TRAIT_DECLARATION | ( | StdTestAllocator< TYPE > | , |
| bslma::IsStdAllocator | |||
| ) |
|
inline |
Create an object of (template parameter) ELEMENT_TYPE at the specified address, constructed by forwarding the specified argument1 and the (variable number of) additional specified arguments to the corresponding constructor of ELEMENT_TYPE.
address refers to a block of memory having sufficient size and alignment for an object of ELEMENT_TYPE.
|
inline |
Return memory previously at the specified address for numElements back to this allocator. The numElements argument is ignored by this allocator type.
address was allocated using this allocator object and has not already been deallocated.
|
inline |
Call the ELEMENT_TYPE destructor for the object at the specified address but do not deallocate the memory at address.
|
inline |
Return the maximum number of elements of type TYPE that can be allocated using this allocator in a single call to the allocate method.