Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::StableDynamicArray< T, ElementsPerPage, Allocator >::Page Struct Reference

Private class used by StableDynamicArray to manage the arrays of data. More...

#include <StableDynamicArray.h>

Public Member Functions

size_t Reserve ()
 Reserve the next availble index and return it. If no more space is available, returns InvalidPage.
 
void Free (T *item)
 Free the given index so it can be reserved again.
 
bool IsFull () const
 True if this page is completely full.
 
bool IsEmpty () const
 True if this page is completely empty.
 
T * GetItem (size_t index)
 
size_t GetItemCount () const
 Gets the number of items allocated on this page.
 

Public Attributes

size_t m_bitStartIndex = 0
 Index of the first uint64_t that might have space.
 
Pagem_nextPage = nullptr
 pointer to the next page.
 
StableDynamicArray< T, ElementsPerPage, Allocator > * m_container
 pointer to the container this page was allocated from.
 
size_t m_pageIndex = 0
 used for comparing pages when items are freed so the earlier page in the list can be cached.
 
size_t m_itemCount = 0
 the number of items in the page.
 
AZStd::array< uint64_t, NumUint64_t > m_bits
 Bits representing free slots in the array. Free slots are 1, occupied slots are 0.
 
AZStd::aligned_storage_t< PageSize, alignof(T)> m_data
 aligned storage for all the actual data.
 

Static Public Attributes

static constexpr size_t InvalidPage = std::numeric_limits<size_t>::max()
 
static constexpr uint64_t FullBits = 0xFFFFFFFFFFFFFFFFull
 
static constexpr size_t NumUint64_t = ElementsPerPage / 64
 

Detailed Description

template<typename T, size_t ElementsPerPage = 512, class Allocator = AZStd::allocator>
struct AZ::StableDynamicArray< T, ElementsPerPage, Allocator >::Page

Private class used by StableDynamicArray to manage the arrays of data.

Member Function Documentation

◆ GetItem()

template<typename T , size_t ElementsPerPage, class Allocator >
T * AZ::StableDynamicArray< T, ElementsPerPage, Allocator >::Page::GetItem ( size_t  index)

Gets a specific item from the Page Note: may return empty slots.


The documentation for this struct was generated from the following files: