Ark Server API (ASE) - Wiki
|
#include <SparseArray.h>
Classes | |
class | FElementCompareClass |
class | TBaseIterator |
class | TConstIterator |
class | TConstSubsetIterator |
class | TIterator |
class | TRangedForConstIterator |
class | TRangedForIterator |
Private Types | |
using | ElementType = InElementType |
typedef TSparseArrayElementOrFreeListLink< TAlignedBytes< sizeof(ElementType), alignof(ElementType)> > | FElementOrFreeListLink |
typedef TArray< FElementOrFreeListLink, typename Allocator::ElementAllocator > | DataType |
typedef TBitArray< typename Allocator::BitArrayAllocator > | AllocationBitArrayType |
Private Member Functions | |
FElementOrFreeListLink & | GetData (int32 Index) |
const FElementOrFreeListLink & | GetData (int32 Index) const |
Static Private Member Functions | |
template<typename SparseArrayType > | |
static FORCEINLINE TEnableIf< TContainerTraits< SparseArrayType >::MoveWillEmptyContainer >::Type | MoveOrCopy (SparseArrayType &ToArray, SparseArrayType &FromArray) |
template<typename SparseArrayType > | |
static FORCEINLINE TEnableIf<!TContainerTraits< SparseArrayType >::MoveWillEmptyContainer >::Type | MoveOrCopy (SparseArrayType &ToArray, SparseArrayType &FromArray) |
Private Attributes | |
DataType | Data |
AllocationBitArrayType | AllocationFlags |
int32 | FirstFreeIndex |
int32 | NumFreeIndices |
Friends | |
struct | TContainerTraits< TSparseArray > |
class | FScriptSparseArray |
bool | operator== (const TSparseArray &A, const TSparseArray &B) |
bool | operator!= (const TSparseArray &A, const TSparseArray &B) |
FORCEINLINE friend TRangedForIterator | begin (TSparseArray &Array) |
FORCEINLINE friend TRangedForConstIterator | begin (const TSparseArray &Array) |
FORCEINLINE friend TRangedForIterator | end (TSparseArray &Array) |
FORCEINLINE friend TRangedForConstIterator | end (const TSparseArray &Array) |
A dynamically sized array where element indices aren't necessarily contiguous. Memory is allocated for all elements in the array's index range, so it doesn't save memory; but it does allow O(1) element removal that doesn't invalidate the indices of subsequent elements. It uses TArray to store the elements, and a TBitArray to store whether each element index is allocated (for fast iteration over allocated elements).
Definition at line 58 of file SparseArray.h.
|
private |
Definition at line 873 of file SparseArray.h.
|
private |
Definition at line 870 of file SparseArray.h.
|
private |
Definition at line 60 of file SparseArray.h.
|
private |
The element type stored is only indirectly related to the element type requested, to avoid instantiating TArray redundantly for compatible types.
Definition at line 839 of file SparseArray.h.
|
inline |
Destructor.
Definition at line 68 of file SparseArray.h.
|
inline |
Default constructor.
Definition at line 474 of file SparseArray.h.
|
inline |
Move constructor.
Definition at line 480 of file SparseArray.h.
|
inline |
Copy constructor.
Definition at line 486 of file SparseArray.h.
|
inline |
Adds an element to the array.
Definition at line 121 of file SparseArray.h.
|
inline |
Allocates space for an element in the array. The element is not initialized, and you must use the corresponding placement new operator to construct the element in the allocated memory.
Definition at line 96 of file SparseArray.h.
|
inline |
Marks an index as allocated, and returns information about the allocation.
Definition at line 75 of file SparseArray.h.
|
inline |
Checks that the specified address is not part of an element within the container. Used for implementations to check that reference arguments aren't going to be invalidated by possible reallocation.
Addr | The address to check. |
Definition at line 603 of file SparseArray.h.
|
inline |
Compacts the allocated elements into a contiguous index range. Returns true if any elements were relocated, false otherwise.
Definition at line 355 of file SparseArray.h.
|
inline |
Compacts the allocated elements into a contiguous index range. Does not change the iteration order of the elements. Returns true if any elements were relocated, false otherwise.
Definition at line 402 of file SparseArray.h.
|
inline |
Creates a const iterator for the contents of this array
Definition at line 759 of file SparseArray.h.
|
inline |
Creates an iterator for the contents of this array
Definition at line 753 of file SparseArray.h.
|
inline |
Removes all elements from the array, potentially leaving space allocated for an expected number of elements about to be added.
ExpectedNumElements | - The expected number of elements about to be added. |
Definition at line 225 of file SparseArray.h.
|
inline |
Helper function to return the amount of memory allocated by this container
Definition at line 427 of file SparseArray.h.
|
inlineprivate |
Accessor for the element or free list data.
Definition at line 859 of file SparseArray.h.
|
inlineprivate |
Accessor for the element or free list data.
Definition at line 865 of file SparseArray.h.
|
inline |
Definition at line 594 of file SparseArray.h.
|
inline |
Inserts an element to the array.
Definition at line 179 of file SparseArray.h.
|
inline |
Allocates space for an element in the array at a given index. The element is not initialized, and you must use the corresponding placement new operator to construct the element in the allocated memory.
Definition at line 132 of file SparseArray.h.
|
inline |
Definition at line 593 of file SparseArray.h.
|
inlinestaticprivate |
Definition at line 552 of file SparseArray.h.
|
inlinestaticprivate |
Definition at line 573 of file SparseArray.h.
|
inline |
Definition at line 595 of file SparseArray.h.
|
inline |
Definition at line 821 of file SparseArray.h.
|
inline |
Concatenation operators
Definition at line 812 of file SparseArray.h.
|
inline |
Copy assignment operator.
Definition at line 504 of file SparseArray.h.
|
inline |
Move assignment operator.
Definition at line 494 of file SparseArray.h.
|
inline |
Definition at line 580 of file SparseArray.h.
|
inline |
Definition at line 586 of file SparseArray.h.
|
inline |
Removes Count elements from the array, starting from Index.
Definition at line 185 of file SparseArray.h.
|
inline |
Removes Count elements from the array, starting from Index, without destructing them.
Definition at line 199 of file SparseArray.h.
|
inline |
Preallocates enough memory to contain the specified number of elements.
ExpectedNumElements | the total number of elements that the array will have |
Definition at line 269 of file SparseArray.h.
|
inline |
Empties the array, but keep its allocated memory as slack.
Definition at line 245 of file SparseArray.h.
|
inline |
Shrinks the array's storage to avoid slack.
Definition at line 299 of file SparseArray.h.
|
friend |
Definition at line 770 of file SparseArray.h.
|
friend |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
Definition at line 769 of file SparseArray.h.
|
friend |
Definition at line 772 of file SparseArray.h.
|
friend |
Definition at line 771 of file SparseArray.h.
|
friend |
Definition at line 63 of file SparseArray.h.
|
friend |
Inequality comparison operator. Checks that both arrays have the same elements and element indices; that means that unallocated elements are signifigant!
Definition at line 468 of file SparseArray.h.
|
friend |
Equality comparison operator. Checks that both arrays have the same elements and element indices; that means that unallocated elements are signifigant!
Definition at line 437 of file SparseArray.h.
|
friend |
Definition at line 44 of file SparseArray.h.
|
private |
Definition at line 874 of file SparseArray.h.
|
private |
Definition at line 871 of file SparseArray.h.
|
private |
The index of an unallocated element in the array that currently contains the head of the linked list of free elements.
Definition at line 877 of file SparseArray.h.
|
private |
The number of elements in the free list.
Definition at line 880 of file SparseArray.h.