|
| StableDynamicArray (allocator_type allocator) |
|
Handle | insert (const value_type &value) |
| Reserves and constructs an item of type T and returns a handle to it.
|
|
Handle | insert (value_type &&value) |
| Reserves and constructs an item of type T and returns a handle to it.
|
|
template<class ... Args> |
Handle | emplace (Args &&... args) |
| Reserves and constructs an item of type T with provided args and returns a handle to it.
|
|
void | erase (Handle &handle) |
| Destructs and frees the memory associated with a handle, then invalidates the handle.
|
|
size_t | size () const |
| Returns the number of items in this container.
|
|
ParallelRanges | GetParallelRanges () |
|
void | DefragmentHandle (Handle &handle) |
|
void | ReleaseEmptyPages () |
| Release any empty pages that may exist to free up memory.
|
|
StableDynamicArrayMetrics | GetMetrics () |
|
iterator | begin () |
| Returns a forward iterator to the start of the array.
|
|
const_iterator | cbegin () const |
|
iterator | end () |
| Returns an iterator representing the end of the array.
|
|
const_iterator | cend () const |
|
size_t | GetPageIndex (const Handle &handle) const |
| Returns the page index for the given handle.
|
|
template<class ... Args> |
auto | emplace (Args &&... args) -> Handle |
|
template<typename T, size_t ElementsPerPage = 512, class Allocator = AZStd::allocator>
class AZ::StableDynamicArray< T, ElementsPerPage, Allocator >
A StableDynamicArray uses a variable number of arrays to store data. Basically this container is a list of arrays, with some information to track usage within those arrays, some optimization to keep jumping through the list to a minimum, and a forward iterator to traverse the whole container. This container produces better cache locality when iterating on elements (vs a list) and keeps appending/removing cost low by reusing empty slots. Resizing is also contained to allocating new arrays. It will always place new items at the front-most slot of the first array with available space. DefragmentHandle() can be called to reorganize data to reduce the amount of empty slots.