Quick Links:

bal | bbl | bdl | bsl

Classes | Public Types | Public Member Functions

bsltf::StdTestAllocator< TYPE > Class Template Reference

#include <bsltf_stdtestallocator.h>

List of all members.

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

 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

Detailed Description

template<class TYPE>
class bsltf::StdTestAllocator< TYPE >

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).

See Component bsltf_stdtestallocator


Member Typedef Documentation

template<class TYPE>
typedef bsls::Types::UintPtr bsltf::StdTestAllocator< TYPE >::size_type
template<class TYPE>
typedef bsls::Types::IntPtr bsltf::StdTestAllocator< TYPE >::difference_type
template<class TYPE>
typedef TYPE* bsltf::StdTestAllocator< TYPE >::pointer
template<class TYPE>
typedef const TYPE* bsltf::StdTestAllocator< TYPE >::const_pointer
template<class TYPE>
typedef TYPE& bsltf::StdTestAllocator< TYPE >::reference
template<class TYPE>
typedef const TYPE& bsltf::StdTestAllocator< TYPE >::const_reference
template<class TYPE>
typedef TYPE bsltf::StdTestAllocator< TYPE >::value_type

Constructor & Destructor Documentation

template<class TYPE>
bsltf::StdTestAllocator< TYPE >::StdTestAllocator (  ) 

Create a StdTestAllocator object.

template<class TYPE>
template<class BDE_OTHER_TYPE >
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.


Member Function Documentation

template<class TYPE>
pointer bsltf::StdTestAllocator< TYPE >::allocate ( size_type  numElements  ) 

Allocate enough (properly aligned) space for the specified numElements of type T. The behavior is undefined unless numElements <= max_size().

template<class TYPE>
void bsltf::StdTestAllocator< TYPE >::deallocate ( pointer  address,
size_type  numElements = 1 
)

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.

template<class TYPE>
template<class ELEMENT_TYPE , class... Args>
void bsltf::StdTestAllocator< TYPE >::construct ( ELEMENT_TYPE *  address,
Args &&...  arguments 
)

TBD: fix comment Copy-construct a TYPE object at the specified address. Do not directly allocate memory. The behavior is undefined unless address is properly aligned for TYPE.

template<class TYPE>
template<class ELEMENT_TYPE >
void bsltf::StdTestAllocator< TYPE >::destroy ( ELEMENT_TYPE *  address  ) 

TBD: fix comment Invoke the TYPE destructor for the object at the specified address.

template<class TYPE>
pointer bsltf::StdTestAllocator< TYPE >::address ( reference  object  )  const

Return the address providing modifiable access to object.

template<class TYPE>
const_pointer bsltf::StdTestAllocator< TYPE >::address ( const_reference  object  )  const

Return the address providing non-modifiable access to object.

template<class TYPE>
size_type bsltf::StdTestAllocator< TYPE >::max_size (  )  const

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.


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