Ark Server API (ASE) - Wiki
|
#include <TIndirectArray.h>
Public Types | |
typedef T | ElementType |
typedef TArray< void *, Allocator > | InternalArrayType |
typedef TIndexedContainerIterator< TIndirectArray, ElementType, int32 > | TIterator |
typedef TIndexedContainerIterator< const TIndirectArray, const ElementType, int32 > | TConstIterator |
Public Member Functions | |
TIndirectArray ()=default | |
TIndirectArray (TIndirectArray &&)=default | |
TIndirectArray & | operator= (TIndirectArray &&)=default |
TIndirectArray (const TIndirectArray &Other) | |
TIndirectArray & | operator= (const TIndirectArray &Other) |
~TIndirectArray () | |
FORCEINLINE int32 | Num () const |
FORCEINLINE T ** | GetData () |
FORCEINLINE const T ** | GetData () const |
uint32 | GetTypeSize () const |
FORCEINLINE T & | operator[] (int32 Index) |
FORCEINLINE const T & | operator[] (int32 Index) const |
FORCEINLINE ElementType & | Last (int32 IndexFromTheEnd=0) |
FORCEINLINE const ElementType & | Last (int32 IndexFromTheEnd=0) const |
void | Shrink () |
void | Reset (int32 NewSize=0) |
void | RemoveAt (int32 Index, int32 Count=1, bool bAllowShrinking=true) |
void | RemoveAtSwap (int32 Index, int32 Count=1, bool bAllowShrinking=true) |
void | Swap (int32 FirstIndexToSwap, int32 SecondIndexToSwap) |
void | Empty (int32 Slack=0) |
FORCEINLINE int32 | Add (T *Item) |
FORCEINLINE void | Insert (T *Item, int32 Index) |
FORCEINLINE void | Reserve (int32 Number) |
FORCEINLINE bool | IsValidIndex (int32 Index) const |
SIZE_T | GetAllocatedSize () const |
TIterator | CreateIterator () |
TConstIterator | CreateConstIterator () const |
Private Member Functions | |
void | DestructAndFreeItems () |
Private Attributes | |
InternalArrayType | Array |
Friends | |
FORCEINLINE friend TDereferencingIterator< ElementType, typename InternalArrayType::RangedForIteratorType > | begin (TIndirectArray &IndirectArray) |
FORCEINLINE friend TDereferencingIterator< const ElementType, typename InternalArrayType::RangedForConstIteratorType > | begin (const TIndirectArray &IndirectArray) |
FORCEINLINE friend TDereferencingIterator< ElementType, typename InternalArrayType::RangedForIteratorType > | end (TIndirectArray &IndirectArray) |
FORCEINLINE friend TDereferencingIterator< const ElementType, typename InternalArrayType::RangedForConstIteratorType > | end (const TIndirectArray &IndirectArray) |
Definition at line 18 of file TIndirectArray.h.
typedef T TIndirectArray< T, Allocator >::ElementType |
Definition at line 21 of file TIndirectArray.h.
typedef TArray<void*, Allocator> TIndirectArray< T, Allocator >::InternalArrayType |
Definition at line 22 of file TIndirectArray.h.
typedef TIndexedContainerIterator<const TIndirectArray, const ElementType, int32> TIndirectArray< T, Allocator >::TConstIterator |
Definition at line 317 of file TIndirectArray.h.
typedef TIndexedContainerIterator< TIndirectArray, ElementType, int32> TIndirectArray< T, Allocator >::TIterator |
Definition at line 316 of file TIndirectArray.h.
|
default |
Default constructors.
|
default |
|
inline |
Copy constructor.
Other | Other array to copy from. |
Definition at line 34 of file TIndirectArray.h.
|
inline |
Destructor.
Definition at line 62 of file TIndirectArray.h.
|
inline |
Adds a new item to the end of the array, possibly reallocating the whole array to fit.
Item | The item to add. |
Definition at line 266 of file TIndirectArray.h.
|
inline |
Creates a const iterator for the contents of this array.
Definition at line 334 of file TIndirectArray.h.
|
inline |
Creates an iterator for the contents of this array.
Definition at line 324 of file TIndirectArray.h.
|
inlineprivate |
Calls destructor and frees memory on every element in the array.
Definition at line 344 of file TIndirectArray.h.
|
inline |
Empties the array. It calls the destructors on held items.
Slack | (Optional) The expected usage size after empty operation. Default is 0. |
Definition at line 253 of file TIndirectArray.h.
|
inline |
Helper function to return the amount of memory allocated by this container
Definition at line 310 of file TIndirectArray.h.
|
inline |
Helper function for returning a typed pointer to the first array entry.
Definition at line 82 of file TIndirectArray.h.
|
inline |
Helper function for returning a typed pointer to the first array entry.
Definition at line 92 of file TIndirectArray.h.
|
inline |
Helper function returning the size of the inner type.
Definition at line 102 of file TIndirectArray.h.
|
inline |
Inserts a given element into the array at given location.
Item | The element to insert. |
Index | Tells where to insert the new elements. |
Definition at line 277 of file TIndirectArray.h.
|
inline |
Tests if index is valid, i.e. greater than zero and less than number of elements in array.
Index | Index to test. |
Definition at line 300 of file TIndirectArray.h.
|
inline |
Returns n-th last element from the array.
IndexFromTheEnd | (Optional) Index from the end of array (default = 0). |
Definition at line 137 of file TIndirectArray.h.
|
inline |
Returns n-th last element from the array.
Const version.
IndexFromTheEnd | (Optional) Index from the end of array (default = 0). |
Definition at line 150 of file TIndirectArray.h.
|
inline |
Gets number of elements in array.
Definition at line 72 of file TIndirectArray.h.
|
inline |
Assignment operator.
Other | Other array to assign with. |
Definition at line 47 of file TIndirectArray.h.
|
default |
|
inline |
Bracket array access operator.
Index | Position of element to return. |
Definition at line 113 of file TIndirectArray.h.
|
inline |
Bracket array access operator.
Const version.
Index | Position of element to return. |
Definition at line 126 of file TIndirectArray.h.
|
inline |
Removes an element (or elements) at given location optionally shrinking the array.
Index | Location in array of the element to remove. |
Count | (Optional) Number of elements to remove. Default is 1. |
bAllowShrinking | (Optional) Tells if this call can shrink array if suitable after remove. Default is true. |
Definition at line 186 of file TIndirectArray.h.
|
inline |
Removes an element (or elements) at given location optionally shrinking the array.
This version is much more efficient than RemoveAt (O(Count) instead of O(ArrayNum)), but does not preserve the order.
Index | Location in array of the element to remove. |
Count | (Optional) Number of elements to remove. Default is 1. |
bAllowShrinking | (Optional) Tells if this call can shrink array if suitable after remove. Default is true. |
Definition at line 216 of file TIndirectArray.h.
|
inline |
Reserves memory such that the array can contain at least Number elements.
Number | The number of elements that the array should be able to contain after allocation. |
Definition at line 288 of file TIndirectArray.h.
|
inline |
Resets the array to the new given size. It calls the destructors on held items.
NewSize | (Optional) The expected usage size after calling this function. Default is 0. |
Definition at line 171 of file TIndirectArray.h.
|
inline |
Shrinks the array's used memory to smallest possible to store elements currently in it.
Definition at line 159 of file TIndirectArray.h.
|
inline |
Element-wise array element swap.
This version is doing more sanity checks than SwapMemory.
FirstIndexToSwap | Position of the first element to swap. |
SecondIndexToSwap | Position of the second element to swap. |
Definition at line 242 of file TIndirectArray.h.
|
friend |
Definition at line 363 of file TIndirectArray.h.
|
friend |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
Definition at line 362 of file TIndirectArray.h.
|
friend |
Definition at line 365 of file TIndirectArray.h.
|
friend |
Definition at line 364 of file TIndirectArray.h.
|
private |
Definition at line 367 of file TIndirectArray.h.