Templated dynamic array 更多...
#include <Array.h>
类 TArray< InElementType, InAllocator > 继承关系图:Public 成员函数 | |
| FORCEINLINE SizeType | Add (const ElementType &Item) |
| Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| FORCEINLINE SizeType | Add (ElementType &&Item) |
| Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| FORCEINLINE ElementType & | Add_GetRef (const ElementType &Item) |
| Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| FORCEINLINE ElementType & | Add_GetRef (ElementType &&Item) |
| Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| SizeType | AddDefaulted (SizeType Count=1) |
| Adds new items to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| ElementType & | AddDefaulted_GetRef () |
| Add a new item to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| FORCEINLINE SizeType | AddUninitialized (SizeType Count=1) |
| Adds a given number of uninitialized elements into the array. 更多... | |
| FORCEINLINE SizeType | AddUnique (const ElementType &Item) |
| Adds unique element to array if it doesn't exist. 更多... | |
| FORCEINLINE SizeType | AddUnique (ElementType &&Item) |
| Adds unique element to array if it doesn't exist. 更多... | |
| SizeType | AddZeroed (SizeType Count=1) |
| Adds new items to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| ElementType & | AddZeroed_GetRef () |
| Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多... | |
| void | Append (const ElementType *Ptr, SizeType Count) |
| Adds a raw array of elements to the end of the TArray. 更多... | |
| template<typename OtherElementType , typename OtherAllocator > | |
| void | Append (const TArray< OtherElementType, OtherAllocator > &Source) |
| Appends the specified array to this array. 更多... | |
| FORCEINLINE void | Append (std::initializer_list< ElementType > InitList) |
| Adds an initializer list of elements to the end of the TArray. 更多... | |
| template<typename OtherElementType , typename OtherAllocator > | |
| void | Append (TArray< OtherElementType, OtherAllocator > &&Source) |
| Appends the specified array to this array. 更多... | |
| FORCEINLINE RangedForIteratorType | begin () |
| DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support. | |
| void | BulkSerialize (FArchive &Ar, bool bForcePerElementSerialization=false) |
| Bulk serialize array as a single memory blob when loading. 更多... | |
| FORCEINLINE void | CheckAddress (const ElementType *Addr) const |
| Checks that the specified address is not part of an element within the container. 更多... | |
| FORCEINLINE void | CheckInvariants () const |
| Checks array invariants: if array size is greater than zero and less than maximum. | |
| template<typename ComparisonType > | |
| bool | Contains (const ComparisonType &Item) const |
| Checks if this array contains the element. 更多... | |
| template<typename Predicate > | |
| FORCEINLINE bool | ContainsByPredicate (Predicate Pred) const |
| Checks if this array contains element for which the predicate is true. 更多... | |
| void | CountBytes (FArchive &Ar) const |
| Count bytes needed to serialize this array. 更多... | |
| TConstIterator | CreateConstIterator () const |
| Creates a const iterator for the contents of this array 更多... | |
| TIterator | CreateIterator () |
| Creates an iterator for the contents of this array 更多... | |
| template<typename... ArgsType> | |
| FORCEINLINE SizeType | Emplace (ArgsType &&... Args) |
| Constructs a new item at the end of the array, possibly reallocating the whole array to fit. 更多... | |
| template<typename... ArgsType> | |
| FORCEINLINE ElementType & | Emplace_GetRef (ArgsType &&... Args) |
| Constructs a new item at the end of the array, possibly reallocating the whole array to fit. 更多... | |
| template<typename... ArgsType> | |
| FORCEINLINE void | EmplaceAt (SizeType Index, ArgsType &&... Args) |
| Constructs a new item at a specified index, possibly reallocating the whole array to fit. 更多... | |
| template<typename... ArgsType> | |
| FORCEINLINE ElementType & | EmplaceAt_GetRef (SizeType Index, ArgsType &&... Args) |
| Constructs a new item at a specified index, possibly reallocating the whole array to fit. 更多... | |
| void | Empty (SizeType Slack=0) |
| Empties the array. 更多... | |
| template<typename Predicate > | |
| TArray< ElementType > | FilterByPredicate (Predicate Pred) const |
| Filters the elements in the array based on a predicate functor. 更多... | |
| SizeType | Find (const ElementType &Item) const |
| Finds element within the array. 更多... | |
| FORCEINLINE bool | Find (const ElementType &Item, SizeType &Index) const |
| Finds element within the array. 更多... | |
| template<typename KeyType > | |
| ElementType * | FindByKey (const KeyType &Key) |
| Finds an item by key (assuming the ElementType overloads operator== for the comparison). 更多... | |
| template<typename KeyType > | |
| FORCEINLINE const ElementType * | FindByKey (const KeyType &Key) const |
| Finds an item by key (assuming the ElementType overloads operator== for the comparison). 更多... | |
| template<typename Predicate > | |
| ElementType * | FindByPredicate (Predicate Pred) |
| Finds an element which matches a predicate functor. 更多... | |
| template<typename Predicate > | |
| FORCEINLINE const ElementType * | FindByPredicate (Predicate Pred) const |
| Finds an element which matches a predicate functor. 更多... | |
| template<typename SearchType > | |
| bool | FindItemByClass (SearchType **Item=nullptr, SizeType *ItemIndex=nullptr, SizeType StartIndex=0) const |
| Searches for the first entry of the specified type, will only work with TArray<UObject*>. 更多... | |
| SizeType | FindLast (const ElementType &Item) const |
| Finds element within the array starting from the end. 更多... | |
| FORCEINLINE bool | FindLast (const ElementType &Item, SizeType &Index) const |
| Finds element within the array starting from the end. 更多... | |
| template<typename Predicate > | |
| FORCEINLINE SizeType | FindLastByPredicate (Predicate Pred) const |
| Searches the array for the last occurrence of an element which matches the specified predicate. 更多... | |
| template<typename Predicate > | |
| SizeType | FindLastByPredicate (Predicate Pred, SizeType Count) const |
| Searches an initial subrange of the array for the last occurrence of an element which matches the specified predicate. 更多... | |
| FORCEINLINE SIZE_T | GetAllocatedSize (void) const |
| Helper function to return the amount of memory allocated by this container. 更多... | |
| FORCEINLINE ElementType * | GetData () |
| Helper function for returning a typed pointer to the first array entry. 更多... | |
| FORCEINLINE const ElementType * | GetData () const |
| Helper function for returning a typed pointer to the first array entry. 更多... | |
| FORCEINLINE SizeType | GetSlack () const |
| Returns the amount of slack in this array in elements. 更多... | |
| FORCEINLINE uint32 | GetTypeSize () const |
| Helper function returning the size of the inner type. 更多... | |
| void | Heapify () |
| Builds an implicit heap from the array. 更多... | |
| template<class PREDICATE_CLASS > | |
| FORCEINLINE void | Heapify (const PREDICATE_CLASS &Predicate) |
| Implicit heaps 更多... | |
| void | HeapPop (ElementType &OutItem, bool bAllowShrinking=true) |
| Removes the top element from the heap. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | HeapPop (ElementType &OutItem, const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true) |
| Removes the top element from the heap. 更多... | |
| void | HeapPopDiscard (bool bAllowShrinking=true) |
| Removes the top element from the heap. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | HeapPopDiscard (const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true) |
| Removes the top element from the heap. 更多... | |
| SizeType | HeapPush (const ElementType &InItem) |
| Adds a new element to the heap. 更多... | |
| template<class PREDICATE_CLASS > | |
| SizeType | HeapPush (const ElementType &InItem, const PREDICATE_CLASS &Predicate) |
| Adds a new element to the heap. 更多... | |
| SizeType | HeapPush (ElementType &&InItem) |
| Adds a new element to the heap. 更多... | |
| template<class PREDICATE_CLASS > | |
| SizeType | HeapPush (ElementType &&InItem, const PREDICATE_CLASS &Predicate) |
| Adds a new element to the heap. 更多... | |
| void | HeapRemoveAt (SizeType Index, bool bAllowShrinking=true) |
| Removes an element from the heap. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | HeapRemoveAt (SizeType Index, const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true) |
| Removes an element from the heap. 更多... | |
| void | HeapSort () |
| Performs heap sort on the array. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | HeapSort (const PREDICATE_CLASS &Predicate) |
| Performs heap sort on the array. 更多... | |
| ElementType & | HeapTop () |
| Returns the top element from the heap (does not remove the element). 更多... | |
| const ElementType & | HeapTop () const |
| Returns the top element from the heap (does not remove the element). 更多... | |
| template<typename KeyType > | |
| SizeType | IndexOfByKey (const KeyType &Key) const |
| Finds an item by key (assuming the ElementType overloads operator== for the comparison). 更多... | |
| template<typename Predicate > | |
| SizeType | IndexOfByPredicate (Predicate Pred) const |
| Finds an item by predicate. 更多... | |
| void | Init (const ElementType &Element, SizeType Number) |
| Sets the size of the array, filling it with the given element. 更多... | |
| SizeType | Insert (const ElementType &Item, SizeType Index) |
| Inserts a given element into the array at given location. 更多... | |
| SizeType | Insert (const ElementType *Ptr, SizeType Count, SizeType Index) |
| Inserts a raw array of elements at a particular index in the TArray. 更多... | |
| template<typename OtherAllocator > | |
| SizeType | Insert (const TArray< ElementType, OtherAllocator > &Items, const SizeType InIndex) |
| Inserts given elements into the array at given location. 更多... | |
| SizeType | Insert (ElementType &&Item, SizeType Index) |
| Inserts a given element into the array at given location. 更多... | |
| SizeType | Insert (std::initializer_list< ElementType > InitList, const SizeType InIndex) |
| Inserts given elements into the array at given location. 更多... | |
| template<typename OtherAllocator > | |
| SizeType | Insert (TArray< ElementType, OtherAllocator > &&Items, const SizeType InIndex) |
| Inserts given elements into the array at given location. 更多... | |
| ElementType & | Insert_GetRef (const ElementType &Item, SizeType Index) |
| Inserts a given element into the array at given location. 更多... | |
| ElementType & | Insert_GetRef (ElementType &&Item, SizeType Index) |
| Inserts a given element into the array at given location. 更多... | |
| void | InsertDefaulted (SizeType Index, SizeType Count=1) |
| Inserts a given number of default-constructed elements into the array at a given location. 更多... | |
| ElementType & | InsertDefaulted_GetRef (SizeType Index) |
| Inserts a default-constructed element into the array at a given location. 更多... | |
| FORCEINLINE void | InsertUninitialized (SizeType Index, SizeType Count=1) |
| Inserts a given number of uninitialized elements into the array at given location. 更多... | |
| void | InsertZeroed (SizeType Index, SizeType Count=1) |
| Inserts a given number of zeroed elements into the array at given location. 更多... | |
| ElementType & | InsertZeroed_GetRef (SizeType Index) |
| Inserts a zeroed element into the array at given location. 更多... | |
| FORCEINLINE bool | IsValidIndex (SizeType Index) const |
| Tests if index is valid, i.e. 更多... | |
| FORCEINLINE ElementType & | Last (SizeType IndexFromTheEnd=0) |
| Returns n-th last element from the array. 更多... | |
| FORCEINLINE const ElementType & | Last (SizeType IndexFromTheEnd=0) const |
| Returns n-th last element from the array. 更多... | |
| FORCEINLINE SizeType | Max () const |
| Returns maximum number of elements in array. 更多... | |
| FORCEINLINE SizeType | Num () const |
| Returns number of elements in array. 更多... | |
| FORCEINLINE bool | operator!= (const TArray &OtherArray) const |
| Inequality operator. 更多... | |
| TArray & | operator+= (const TArray &Other) |
| Appends the specified array to this array. 更多... | |
| TArray & | operator+= (std::initializer_list< ElementType > InitList) |
| Appends the specified initializer list to this array. 更多... | |
| TArray & | operator+= (TArray &&Other) |
| Appends the specified array to this array. 更多... | |
| TArray & | operator= (const TArray &Other) |
| Assignment operator. 更多... | |
| template<typename OtherAllocator > | |
| TArray & | operator= (const TArray< ElementType, OtherAllocator > &Other) |
| Assignment operator. 更多... | |
| TArray & | operator= (std::initializer_list< InElementType > InitList) |
| Initializer list assignment operator. 更多... | |
| TArray & | operator= (TArray &&Other) |
| Move assignment operator. 更多... | |
| bool | operator== (const TArray &OtherArray) const |
| Equality operator. 更多... | |
| FORCEINLINE ElementType & | operator[] (SizeType Index) |
| Array bracket operator. 更多... | |
| FORCEINLINE const ElementType & | operator[] (SizeType Index) const |
| Array bracket operator. 更多... | |
| FORCEINLINE ElementType | Pop (bool bAllowShrinking=true) |
| Pops element from the array. 更多... | |
| FORCEINLINE void | Push (const ElementType &Item) |
| Pushes element into the array. 更多... | |
| FORCEINLINE void | Push (ElementType &&Item) |
| Pushes element into the array. 更多... | |
| FORCEINLINE void | RangeCheck (SizeType Index) const |
| Checks if index is in array range. 更多... | |
| SizeType | Remove (const ElementType &Item) |
| Removes as many instances of Item as there are in the array, maintaining order but not indices. 更多... | |
| template<class PREDICATE_CLASS > | |
| SizeType | RemoveAll (const PREDICATE_CLASS &Predicate) |
| Remove all instances that match the predicate, maintaining order but not indices Optimized to work with runs of matches/non-matches 更多... | |
| template<class PREDICATE_CLASS > | |
| SizeType | RemoveAllSwap (const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true) |
| Remove all instances that match the predicate 更多... | |
| FORCEINLINE void | RemoveAt (SizeType Index) |
| Removes an element (or elements) at given location optionally shrinking the array. 更多... | |
| template<typename CountType > | |
| FORCEINLINE void | RemoveAt (SizeType Index, CountType Count, bool bAllowShrinking=true) |
| Removes an element (or elements) at given location optionally shrinking the array. 更多... | |
| FORCEINLINE void | RemoveAtSwap (SizeType Index) |
| Removes an element (or elements) at given location optionally shrinking the array. 更多... | |
| template<typename CountType > | |
| FORCEINLINE void | RemoveAtSwap (SizeType Index, CountType Count, bool bAllowShrinking=true) |
| Removes an element (or elements) at given location optionally shrinking the array. 更多... | |
| SizeType | RemoveSingle (const ElementType &Item) |
| Removes the first occurrence of the specified item in the array, maintaining order but not indices. 更多... | |
| SizeType | RemoveSingleSwap (const ElementType &Item, bool bAllowShrinking=true) |
| Removes the first occurrence of the specified item in the array. 更多... | |
| SizeType | RemoveSwap (const ElementType &Item, bool bAllowShrinking=true) |
| Removes item from the array. 更多... | |
| FORCEINLINE void | Reserve (SizeType Number) |
| Reserves memory such that the array can contain at least Number elements. 更多... | |
| void | Reset (SizeType NewSize=0) |
| Same as empty, but doesn't change memory allocations, unless the new size is larger than the current array. 更多... | |
| void | SetNum (SizeType NewNum, bool bAllowShrinking=true) |
| Resizes array to given number of elements. 更多... | |
| void | SetNumUninitialized (SizeType NewNum, bool bAllowShrinking=true) |
| Resizes array to given number of elements. 更多... | |
| void | SetNumUnsafeInternal (SizeType NewNum) |
| Does nothing except setting the new number of elements in the array. 更多... | |
| void | SetNumZeroed (SizeType NewNum, bool bAllowShrinking=true) |
| Resizes array to given number of elements. 更多... | |
| FORCEINLINE void | Shrink () |
| Shrinks the array's used memory to smallest possible to store elements currently in it. 更多... | |
| void | Sort () |
| Sorts the array assuming < operator is defined for the item type. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | Sort (const PREDICATE_CLASS &Predicate) |
| Sorts the array using user define predicate class. 更多... | |
| void | StableSort () |
| Stable sorts the array assuming < operator is defined for the item type. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | StableSort (const PREDICATE_CLASS &Predicate) |
| Stable sorts the array using user defined predicate class. 更多... | |
| FORCEINLINE void | Swap (SizeType FirstIndexToSwap, SizeType SecondIndexToSwap) |
| Element-wise array element swap. 更多... | |
| FORCEINLINE void | SwapMemory (SizeType FirstIndexToSwap, SizeType SecondIndexToSwap) |
| Element-wise array memory swap. 更多... | |
| FORCEINLINE | TArray () |
| Constructor, initializes element number counters. | |
| FORCEINLINE | TArray (const ElementType *Ptr, SizeType Count) |
| Constructor from a raw array of elements. 更多... | |
| FORCEINLINE | TArray (const TArray &Other) |
| Copy constructor. 更多... | |
| FORCEINLINE | TArray (const TArray &Other, SizeType ExtraSlack) |
| Copy constructor. 更多... | |
| template<typename OtherElementType , typename OtherAllocator > | |
| FORCEINLINE | TArray (const TArray< OtherElementType, OtherAllocator > &Other) |
| Copy constructor with changed allocator. 更多... | |
| TArray (std::initializer_list< InElementType > InitList) | |
| Initializer list constructor | |
| FORCEINLINE | TArray (TArray &&Other) |
| Move constructor. 更多... | |
| template<typename OtherElementType > | |
| TArray (TArray< OtherElementType, Allocator > &&Other, SizeType ExtraSlack) | |
| Move constructor. 更多... | |
| template<typename OtherElementType , typename OtherAllocator > | |
| FORCEINLINE | TArray (TArray< OtherElementType, OtherAllocator > &&Other) |
| Move constructor. 更多... | |
| FORCEINLINE ElementType & | Top () |
| Returns the top element, i.e. 更多... | |
| FORCEINLINE const ElementType & | Top () const |
| Returns the top element, i.e. 更多... | |
| template<class PREDICATE_CLASS > | |
| void | VerifyHeap (const PREDICATE_CLASS &Predicate) |
| Verifies the heap. 更多... | |
| ~TArray () | |
| Destructor. | |
友元 | |
| FArchive & | operator<< (FArchive &Ar, TArray &A) |
| Serialization operator. 更多... | |
Templated dynamic array
A dynamically sized array of typed elements. Makes the assumption that your elements are relocate-able; i.e. that they can be transparently moved to new memory without a copy constructor. The main implication is that pointers to elements in the TArray may be invalidated by adding or removing other elements to the array. Removal of elements is O(N) and invalidates the indices of subsequent elements.
Caution: as noted below some methods are not safe for element types that require constructors.
|
inline |
Constructor from a raw array of elements.
| Ptr | A pointer to an array of elements to copy. |
| Count | The number of elements to copy from Ptr. |
|
inlineexplicit |
Copy constructor with changed allocator.
Use the common routine to perform the copy.
| Other | The source array to copy. |
|
inline |
Copy constructor.
Use the common routine to perform the copy.
| Other | The source array to copy. |
|
inline |
Copy constructor.
Use the common routine to perform the copy.
| Other | The source array to copy. |
| ExtraSlack | Tells how much extra memory should be preallocated at the end of the array in the number of elements. |
|
inline |
Move constructor.
| Other | Array to move from. |
|
inlineexplicit |
Move constructor.
| Other | Array to move from. |
|
inline |
Move constructor.
| Other | Array to move from. |
| ExtraSlack | Tells how much extra memory should be preallocated at the end of the array in the number of elements. |
|
inline |
Adds a new item to the end of the array, possibly reallocating the whole array to fit.
| Item | The item to add |
|
inline |
Adds a new item to the end of the array, possibly reallocating the whole array to fit.
Move semantics version.
| Item | The item to add |
|
inline |
Adds a new item to the end of the array, possibly reallocating the whole array to fit.
| Item | The item to add |
|
inline |
Adds a new item to the end of the array, possibly reallocating the whole array to fit.
Move semantics version.
| Item | The item to add |
|
inline |
|
inline |
Add a new item to the end of the array, possibly reallocating the whole array to fit.
The new item will be default-constructed.
|
inline |
Adds a given number of uninitialized elements into the array.
Caution, AddUninitialized() will create elements without calling the constructor and this is not appropriate for element types that require a constructor to function properly.
| Count | Number of elements to add. |
|
inline |
Adds unique element to array if it doesn't exist.
| Args | Item to add. |
|
inline |
Adds unique element to array if it doesn't exist.
Move semantics version.
| Args | Item to add. |
|
inline |
Adds new items to the end of the array, possibly reallocating the whole array to fit.
The new items will be zeroed.
Caution, AddZeroed() will create elements without calling the constructor and this is not appropriate for element types that require a constructor to function properly.
| Count | The number of new items to add. |
|
inline |
Adds a new item to the end of the array, possibly reallocating the whole array to fit.
The new item will be zeroed.
Caution, AddZeroed_GetRef() will create elements without calling the constructor and this is not appropriate for element types that require a constructor to function properly.
|
inline |
|
inline |
|
inline |
Bulk serialize array as a single memory blob when loading.
Uses regular serialization code for saving and doesn't serialize at all otherwise (e.g. transient, garbage collection, ...).
Requirements:
Notes:
IMPORTANT:
|
inline |
|
inline |
Checks if this array contains the element.
|
inline |
|
inline |
Count bytes needed to serialize this array.
| Ar | Archive to count for. |
|
inline |
Creates a const iterator for the contents of this array
|
inline |
Creates an iterator for the contents of this array
|
inline |
Constructs a new item at the end of the array, possibly reallocating the whole array to fit.
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Constructs a new item at the end of the array, possibly reallocating the whole array to fit.
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Constructs a new item at a specified index, possibly reallocating the whole array to fit.
| Index | The index to add the item at. |
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Constructs a new item at a specified index, possibly reallocating the whole array to fit.
| Index | The index to add the item at. |
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Empties the array.
It calls the destructors on held items if needed.
| Slack | (Optional) The expected usage size after empty operation. Default is 0. |
|
inline |
Filters the elements in the array based on a predicate functor.
| Pred | The functor to apply to each element. |
|
inline |
Finds element within the array.
| Item | Item to look for. |
|
inline |
Finds element within the array.
| Item | Item to look for. |
| Index | Will contain the found index. |
|
inline |
Finds an item by key (assuming the ElementType overloads operator== for the comparison).
Time Complexity: O(n), starts iteration from the beginning so better performance if Key is in the front
| Key | The key to search by. |
|
inline |
Finds an item by key (assuming the ElementType overloads operator== for the comparison).
| Key | The key to search by. |
|
inline |
Finds an element which matches a predicate functor.
| Pred | The functor to apply to each element. true, or nullptr if none is found. |
|
inline |
Finds an element which matches a predicate functor.
| Pred | The functor to apply to each element. |
|
inline |
Searches for the first entry of the specified type, will only work with TArray<UObject*>.
Optionally return the item's index, and can specify the start index.
| Item | (Optional output) If it's not null, then it will point to the found element. Untouched if element hasn't been found. |
| ItemIndex | (Optional output) If it's not null, then it will be set to the position of found element in the array. Untouched if element hasn't been found. |
| StartIndex | (Optional) Index in array at which the function should start to look for element. |
|
inline |
Finds element within the array starting from the end.
| Item | Item to look for. |
|
inline |
Finds element within the array starting from the end.
| Item | Item to look for. |
| Index | Output parameter. Found index. |
|
inline |
Searches the array for the last occurrence of an element which matches the specified predicate.
| Pred | Predicate taking array element and returns true if element matches search criteria, false otherwise. |
|
inline |
Searches an initial subrange of the array for the last occurrence of an element which matches the specified predicate.
| Pred | Predicate taking array element and returns true if element matches search criteria, false otherwise. |
| Count | The number of elements from the front of the array through which to search. |
|
inline |
Helper function to return the amount of memory allocated by this container.
Only returns the size of allocations made directly by the container, not the elements themselves.
|
inline |
Helper function for returning a typed pointer to the first array entry.
|
inline |
Helper function for returning a typed pointer to the first array entry.
|
inline |
|
inline |
Helper function returning the size of the inner type.
|
inline |
Builds an implicit heap from the array.
Assumes < operator is defined for the template type.
|
inline |
Implicit heaps
Builds an implicit heap from the array.
| Predicate | Predicate class instance. |
|
inline |
Removes the top element from the heap.
Assumes < operator is defined for the template type.
| OutItem | The removed item. |
| bAllowShrinking | (Optional) Tells if this call can shrink the array allocation if suitable after the pop. Default is true. |
|
inline |
Removes the top element from the heap.
| OutItem | The removed item. |
| Predicate | Predicate class instance. |
|
inline |
Removes the top element from the heap.
Assumes < operator is defined for the template type.
| bAllowShrinking | (Optional) Tells if this call can shrink the array allocation if suitable after the discard. Default is true. |
|
inline |
Removes the top element from the heap.
| Predicate | Predicate class instance. |
| bAllowShrinking | (Optional) Tells if this call can shrink the array allocation if suitable after the discard. Default is true. |
|
inline |
Adds a new element to the heap.
Assumes < operator is defined for the template type.
| InItem | Item to be added. |
|
inline |
Adds a new element to the heap.
| InItem | Item to be added. |
| Predicate | Predicate class instance. |
|
inline |
Adds a new element to the heap.
Assumes < operator is defined for the template type.
| InItem | Item to be added. |
|
inline |
Adds a new element to the heap.
| InItem | Item to be added. |
| Predicate | Predicate class instance. |
|
inline |
Removes an element from the heap.
Assumes < operator is defined for the template type.
| Index | Position at which to remove item. |
| bAllowShrinking | (Optional) Tells if this call can shrink the array allocation if suitable after the remove (default = true). |
|
inline |
Removes an element from the heap.
| Index | Position at which to remove item. |
| Predicate | Predicate class instance. |
| bAllowShrinking | (Optional) Tells if this call can shrink the array allocation if suitable after the remove (default = true). |
|
inline |
Performs heap sort on the array.
Assumes < operator is defined for the template type.
|
inline |
Performs heap sort on the array.
| Predicate | Predicate class instance. |
|
inline |
Returns the top element from the heap (does not remove the element).
|
inline |
Returns the top element from the heap (does not remove the element).
Const version.
|
inline |
Finds an item by key (assuming the ElementType overloads operator== for the comparison).
| Key | The key to search by. |
|
inline |
Finds an item by predicate.
| Pred | The predicate to match. |
|
inline |
Sets the size of the array, filling it with the given element.
| Element | The element to fill array with. |
| Number | The number of elements that the array should be able to contain after allocation. |
|
inline |
|
inline |
|
inline |
Inserts given elements into the array at given location.
| Items | Array of elements to insert. |
| InIndex | Tells where to insert the new elements. |
|
inline |
|
inline |
Inserts given elements into the array at given location.
| Items | Array of elements to insert. |
| InIndex | Tells where to insert the new elements. |
|
inline |
Inserts given elements into the array at given location.
| Items | Array of elements to insert. |
| InIndex | Tells where to insert the new elements. |
|
inline |
|
inline |
|
inline |
Inserts a given number of default-constructed elements into the array at a given location.
| Index | Tells where to insert the new elements. |
| Count | Number of elements to add. |
|
inline |
Inserts a default-constructed element into the array at a given location.
| Index | Tells where to insert the new element. |
|
inline |
Inserts a given number of uninitialized elements into the array at given location.
Caution, InsertUninitialized() will create elements without calling the constructor and this is not appropriate for element types that require a constructor to function properly.
| Index | Tells where to insert the new elements. |
| Count | Number of elements to add. |
|
inline |
Inserts a given number of zeroed elements into the array at given location.
Caution, InsertZeroed() will create elements without calling the constructor and this is not appropriate for element types that require a constructor to function properly.
| Index | Tells where to insert the new elements. |
| Count | Number of elements to add. |
|
inline |
Inserts a zeroed element into the array at given location.
Caution, InsertZeroed_GetRef() will create an element without calling the constructor and this is not appropriate for element types that require a constructor to function properly.
| Index | Tells where to insert the new element. |
|
inline |
Tests if index is valid, i.e.
greater than or equal to zero, and less than the number of elements in the array.
| Index | Index to test. |
|
inline |
Returns n-th last element from the array.
| IndexFromTheEnd | (Optional) Index from the end of array (default = 0). |
|
inline |
Returns n-th last element from the array.
Const version of the above.
| IndexFromTheEnd | (Optional) Index from the end of array (default = 0). |
|
inline |
|
inline |
|
inline |
Inequality operator.
| OtherArray | Array to compare. |
|
inline |
Appends the specified array to this array.
Cannot append to self.
| Other | The array to append. |
|
inline |
Appends the specified initializer list to this array.
| InitList | The initializer list to append. |
|
inline |
Appends the specified array to this array.
Cannot append to self.
Move semantics version.
| Other | The array to append. |
|
inline |
Assignment operator.
First deletes all currently contained elements and then copies from other array.
| Other | The source array to assign from. |
|
inline |
Assignment operator.
First deletes all currently contained elements and then copies from other array.
Allocator changing version.
| Other | The source array to assign from. |
|
inline |
Initializer list assignment operator.
First deletes all currently contained elements and then copies from initializer list.
| InitList | The initializer_list to copy from. |
|
inline |
Move assignment operator.
| Other | Array to assign and move from. |
|
inline |
Equality operator.
| OtherArray | Array to compare. |
|
inline |
Array bracket operator.
Returns reference to element at give index.
|
inline |
Array bracket operator.
Returns reference to element at give index.
Const version of the above.
|
inline |
Pops element from the array.
| bAllowShrinking | If this call allows shrinking of the array during element remove. |
|
inline |
|
inline |
Pushes element into the array.
| Item | Item to push. |
|
inline |
Checks if index is in array range.
| Index | Index to check. |
|
inline |
Removes as many instances of Item as there are in the array, maintaining order but not indices.
| Item | Item to remove from array. |
|
inline |
Remove all instances that match the predicate, maintaining order but not indices Optimized to work with runs of matches/non-matches
| Predicate | Predicate class instance |
|
inline |
Remove all instances that match the predicate
| Predicate | Predicate class instance |
| bAllowShrinking | Tell if this function can shrink the memory in-use if suitable. |
|
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. |
|
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. |
|
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. |
|
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. |
|
inline |
Removes the first occurrence of the specified item in the array, maintaining order but not indices.
| Item | The item to remove. |
|
inline |
Removes the first occurrence of the specified item in the array.
This version is much more efficient O(Count) instead of O(ArrayNum), but does not preserve the order
| Item | The item to remove |
| bAllowShrinking | Tell if this function can shrink the memory in-use if suitable. |
|
inline |
Removes item from the array.
This version is much more efficient, because it uses RemoveAtSwap internally which is O(Count) instead of RemoveAt which is O(ArrayNum), but does not preserve the order.
|
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. |
|
inline |
Same as empty, but doesn't change memory allocations, unless the new size is larger than the current array.
It calls the destructors on held items if needed and then zeros the ArrayNum.
| NewSize | The expected usage size after calling this function. |
|
inline |
Resizes array to given number of elements.
| NewNum | New size of the array. |
| bAllowShrinking | Tell if this function can shrink the memory in-use if suitable. |
|
inline |
Resizes array to given number of elements.
New elements will be uninitialized.
| NewNum | New size of the array. |
|
inline |
Does nothing except setting the new number of elements in the array.
Does not destruct items, does not de-allocate memory.
| NewNum | New number of elements in the array, must be <= the current number of elements in the array. |
|
inline |
Resizes array to given number of elements.
New elements will be zeroed.
| NewNum | New size of the array. |
|
inline |
Shrinks the array's used memory to smallest possible to store elements currently in it.
|
inline |
Sorts the array assuming < operator is defined for the item type.
|
inline |
Sorts the array using user define predicate class.
| Predicate | Predicate class instance. |
|
inline |
Stable sorts the array assuming < operator is defined for the item type.
Stable sort is slower than non-stable algorithm.
|
inline |
Stable sorts the array using user defined predicate class.
Stable sort is slower than non-stable algorithm.
| Predicate | Predicate class instance |
|
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. |
|
inline |
Element-wise array memory swap.
| FirstIndexToSwap | Position of the first element to swap. |
| SecondIndexToSwap | Position of the second element to swap. |
|
inline |
|
inline |
|
inline |
Verifies the heap.
| Predicate | Predicate class instance. |
|
friend |
Serialization operator.
| Ar | Archive to serialize the array with. |
| A | Array to serialize. |