BDE 4.14.0 Production release
|
#include <bsltf_stdtestallocator.h>
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 () | |
Create a StdTestAllocator object. | |
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 |
Return the address providing modifiable access to object . | |
const_pointer | address (const_reference object) const |
Return the address providing non-modifiable access to object . | |
size_type | max_size () const |
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).
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 |
bsltf::StdTestAllocator< TYPE >::StdTestAllocator | ( | const StdTestAllocator< BDE_OTHER_TYPE > & | ) |
Create a StdTestAllocator
object. Note that this object will compare equal to the default constructed object, because this type has no state.
|
inline |
|
inline |
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. The behavior is undefined unless 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
. The behavior is undefined unless 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. The behavior is undefined unless 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. Note that there is no guarantee that attempts at allocating less elements than the value returned by max_size will not throw.