Open 3D Engine AzCore API Reference  2305.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZStd::deque< T, Allocator, NumElementsPerBlock, MinMapSize > Class Template Reference

#include <deque.h>

Public Types

typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef Allocator allocator_type
 
typedef T value_type
 
typedef block_node block_node_type
 
typedef pointer map_node_type
 
typedef map_node_type * map_node_ptr_type
 
using iterator = deque_iterator_impl< T, Allocator, NumElementsPerBlock, MinMapSize >
 
using const_iterator = basic_const_iterator< iterator >
 
using difference_type = typename iterator::difference_type
 
using size_type = make_unsigned_t< difference_type >
 
typedef
AZStd::reverse_iterator
< iterator
reverse_iterator
 
typedef
AZStd::reverse_iterator
< const_iterator
const_reverse_iterator
 

Public Member Functions

AZ_FORCE_INLINE deque (const Allocator &allocator)
 
AZ_FORCE_INLINE deque (size_type numElements)
 
AZ_FORCE_INLINE deque (size_type numElements, const value_type &value)
 
AZ_FORCE_INLINE deque (size_type numElements, const value_type &value, const Allocator &allocator)
 
AZ_FORCE_INLINE deque (const this_type &rhs)
 
ilist end ()
 

Public Attributes

template<class InputIterator >
 __pad0__: m_allocator(allocator) { construct_iter(first
 
template<class InputIterator >
 last
 
template<class InputIterator >
 is_integral< InputIterator > {})
 
template<class R , class = enable_if_t<Internal::container_compatible_range<R, value_type>>>
 __pad1__: m_allocator(alloc) { assign_range(AZStd::forward<R>(rg))
 
 __pad2__: deque(ilist.begin()
 
ilist alloc
 Pointer to array of pointers to blocks.
 
size_type m_mapSize {}
 Size of map array.
 
size_type m_firstOffset {}
 Offset of initial element.
 
size_type m_size {}
 Number of elements in the deque.
 
allocator_type m_allocator {}
 Instance of the allocator.
 

Detailed Description

template<class T, class Allocator = AZStd::allocator, AZStd::size_t NumElementsPerBlock = AZStd::deque_block<sizeof(T)>::num_elements, AZStd::size_t MinMapSize = 8>
class AZStd::deque< T, Allocator, NumElementsPerBlock, MinMapSize >

The deque is complaint with CStd (23.2.1). In addition we introduce the following extensions.

As you know Deque allocate memory in blocks. Each block has NumElementsPerBlock * sizeof(T) size. As extension you are allowed to control the number of elements per block or the minimal map size. This way you can get the optimal balance between memory usage and number of allocation. Unless speed is critical you should not worry about that too much and use the default settings. If you want to pool or just know the node size you can use deque::block_node_type.

Check the deque AZStdExamples.

Attention
If you customize the block and map sizes make sure that NumElementsPerBlock and MinMapSize are >= 1.

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