Navigation
API > API/Runtime > API/Runtime/uLangCore
Templated dynamic array of shared pointers to elements
| Name | TSPtrArrayG |
| Type | class |
| Header File | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Containers/SharedPointer.h |
| Include Path | #include "uLang/Common/Containers/SharedPointer.h" |
| Source | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Containers/SharedPointerArray.h |
Syntax
template<typename InElementType, bool AllowNull, typename InElementAllocatorType, typename... RawAllocatorArgsType>
class TSPtrArrayG
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULANG_FORCEINLINE TSPtrArrayG
(
const TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType......, |
Implicitly casting copy-ish constructor with extra slack. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE TSPtrArrayG
(
RawAllocatorArgsType&&... RawAllocatorArgs |
Constructor | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE TSPtrArrayG
(
const TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType...... |
Implicitly casting copy-ish constructor. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE TSPtrArrayG
(
const TSPtrArrayG& Other |
Copy constructor. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE TSPtrArrayG
(
TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... >&& ... |
Implicitly casting move-ish constructor. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE TSPtrArrayG
(
TSPtrArrayG&& Other |
Move constructor. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE TSPtrArrayG
(
std::initializer_list< TSPtrG< OtherElementType, OtherAllowNull, typename InElementAllocatorType::Ra..., |
Initializer list constructor | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG
(
TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... >&& ..., |
Implicitly casting move-ish constructor with extra slack. | uLang/Common/Containers/SharedPointerArray.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TSPtrArrayG() |
Destructor. | uLang/Common/Containers/SharedPointerArray.h |
Interfaces
| Name | Remarks |
|---|---|
| Iterator | STL-like iterator to enable range-based for loop support. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DereferenceFuncType | void(*)(ElementType *, const typename ElementAllocatorType::RawAllocatorType &) | Indirection to keep knowledge about ElementType out of default constructor and destructor so that TSPtrArrayG can be forward declared with an incomplete ElementType argument The price we pay is 8 more bytes of memory, indirect function call on each dereference, and that we have to (re-)initialize this function pointer in all methods that can make an empty array non-empty | uLang/Common/Containers/SharedPointerArray.h |
| ElementAllocatorType | InElementAllocatorType | uLang/Common/Containers/SharedPointerArray.h | |
| ElementType | InElementType | uLang/Common/Containers/SharedPointerArray.h | |
| PointerStorageType | TArrayG< ElementType *, InElementAllocatorType, RawAllocatorArgsType... > | uLang/Common/Containers/SharedPointerArray.h | |
| PointerType | TSPtrG< ElementType, AllowNull, typename InElementAllocatorType::RawAllocatorType, RawAllocatorArgsType... > | uLang/Common/Containers/SharedPointerArray.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULANG_FORCEINLINE int32_t Add
(
const PointerType& Item |
Adds a new item to the end of the array, possibly reallocating the whole array to fit. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t AddNew
(
CtorArgsType&&... CtorArgs |
Constructs a new item at the end of the array, possibly reallocating the whole array to fit. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t AddUnique
(
const PointerType& Item |
Adds unique element to array if it doesn't exist. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t AddZeroed
(
int32_t Count |
Adds new items to the end of the array, possibly reallocating the whole array to fit. | uLang/Common/Containers/SharedPointerArray.h | |
void Append
(
TSPtrArrayG&& Source |
Appends the specified array to this array. | uLang/Common/Containers/SharedPointerArray.h | |
void Append
(
TSPtrArrayG& Source |
Appends the specified array to this array.Allocator changing version. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE const TSPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & As () |
uLang/Common/Containers/SharedPointerArray.h | ||
ULANG_FORCEINLINETSPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & As () |
Casts TSPtrArray |
uLang/Common/Containers/SharedPointerArray.h | |
| uLang/Common/Containers/SharedPointerArray.h | |||
| uLang/Common/Containers/SharedPointerArray.h | |||
bool Contains
(
const PointerType& Pointer |
Checks if this array contains the exact pointer. | uLang/Common/Containers/SharedPointerArray.h | |
bool ContainsByKey
(
const ComparisonType& Key |
Checks if this array contains the element. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE bool ContainsByPredicate
(
Predicate Pred |
Checks if this array contains element for which the predicate is true. | uLang/Common/Containers/SharedPointerArray.h | |
void Empty
(
int32_t Slack |
Empties the array. It calls the destructors on held items if needed. | uLang/Common/Containers/SharedPointerArray.h | |
| uLang/Common/Containers/SharedPointerArray.h | |||
| uLang/Common/Containers/SharedPointerArray.h | |||
ULANG_FORCEINLINE int32_t Find
(
const ElementType* Item |
Finds element within the array (by address comparison). | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE bool Find
(
const PointerType& Item, |
uLang/Common/Containers/SharedPointerArray.h | ||
ULANG_FORCEINLINE int32_t Find
(
const PointerType& Item |
uLang/Common/Containers/SharedPointerArray.h | ||
ULANG_FORCEINLINE bool Find
(
const ElementType* Item, |
Finds element within the array (by address comparison). | uLang/Common/Containers/SharedPointerArray.h | |
| Finds an item by key (assuming the ElementType overloads operator== for the comparison). | uLang/Common/Containers/SharedPointerArray.h | ||
ULANG_FORCEINLINETOptional< PointerType > FindByPredicate
(
Predicate Pred |
Finds an element which matches a predicate functor. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t FindLast
(
const PointerType& Item |
Finds element within the array starting from the end (by address comparison). | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE bool FindLast
(
const PointerType& Item, |
Finds element within the array starting from the end (by address comparison). | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t FindLastByPredicate
(
Predicate Pred, |
Searches an initial subrange of the array for the last occurrence of an element which matches the specified predicate. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t FindLastByPredicate
(
Predicate Pred |
Searches the array for the last occurrence of an element which matches the specified predicate. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINEPointerType First () |
Returns the first element. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t GetSlack () |
Returns the amount of slack in this array in elements. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t IndexOfByKey
(
const KeyType& Key |
Finds an item by key (assuming the ElementType overloads operator== for the comparison). | uLang/Common/Containers/SharedPointerArray.h | |
int32_t IndexOfByPredicate
(
Predicate Pred |
Finds an item by predicate. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t Insert
(
TSPtrArrayG&& Items, |
Inserts given elements into the array at given location. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t Insert
(
const PointerType& Item, |
Inserts a given element into the array at given location. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t Insert
(
const TSPtrArrayG& Items, |
Inserts given elements into the array at given location. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void InsertNew
(
int32_t Index, |
Constructs a new item at a specified index, possibly reallocating the whole array to fit. | uLang/Common/Containers/SharedPointerArray.h | |
void InsertZeroed
(
int32_t Index, |
Inserts a given number of zeroed elements into the array at given location. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE bool IsEmpty () |
Returns true if no elements in array | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE bool IsFilled () |
Returns true if any elements in array | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE bool IsValidIndex
(
int32_t Index |
Tests if index is valid, i.e. greater than or equal to zero, and less than the number of elements in the array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINEPointerType Last
(
int32_t IndexFromTheEnd |
Returns n-th last element from the array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t Max () |
Returns maximum number of elements in array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE int32_t Num () |
Returns number of elements in array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINEPointerType Pop
(
bool bAllowShrinking |
Pops element from the array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void Push
(
const PointerType& Item |
Pushes element into the array. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t Remove
(
const PointerType& Item |
Removes as many instances of Item as there are in the array, maintaining order but not indices. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t RemoveAll
(
const Predicate& Pred |
Remove all instances that match the predicate, maintaining order but not indices Optimized to work with runs of matches/non-matches | uLang/Common/Containers/SharedPointerArray.h | |
void RemoveAllSwap
(
const Predicate& Pred, |
Remove all instances that match the predicate | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void RemoveAt
(
int32_t Index, |
Removes an element (or elements) at given location optionally shrinking the array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINEPointerType RemoveAt
(
int32_t Index |
Removes an element (or elements) at given location optionally shrinking the array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void RemoveAtSwap
(
int32_t Index |
Removes an element (or elements) at given location optionally shrinking the array. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void RemoveAtSwap
(
int32_t Index, |
Removes an element (or elements) at given location optionally shrinking the array. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t RemoveSingle
(
const PointerType& Item |
Removes the first occurrence of the specified item in the array, maintaining order but not indices. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t RemoveSingleSwap
(
const PointerType& Item, |
Removes the first occurrence of the specified item in the array. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t RemoveSwap
(
const PointerType& Item |
Removes item from the array. | uLang/Common/Containers/SharedPointerArray.h | |
int32_t ReplaceAt
(
const PointerType& Item, |
Replaces a given element at a given location. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void Reserve
(
int32_t Number |
Reserves memory such that the array can contain at least Number elements. | uLang/Common/Containers/SharedPointerArray.h | |
void Reset
(
int32_t NewSize |
Same as empty, but doesn't change memory allocations, unless the new size is larger than the current array. | uLang/Common/Containers/SharedPointerArray.h | |
void SetNumZeroed
(
int32_t NewNum, |
Resizes array to given number of elements. New elements will be zeroed. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void Shrink () |
Shrinks the array's used pointer memory to smallest possible to store elements currently in it. | uLang/Common/Containers/SharedPointerArray.h | |
void Sort () |
Sorts the array assuming < operator is defined for ElementType. | uLang/Common/Containers/SharedPointerArray.h | |
void Sort
(
const PredicateType& Predicate |
Sorts the array using user define predicate class. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINEPointerType Top () |
Returns the top element, i.e. the last one. | uLang/Common/Containers/SharedPointerArray.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULANG_FORCEINLINE void Dereference
(
int32_t Index |
Decrement reference count on an element | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void DereferenceAll() |
Decrement reference count on all elements. Delete elements whose reference count reaches zero. | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void DereferenceRange
(
int32_t BeginIndex, |
Decrement reference count on a range of elements | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void EnableDereference() |
Set the release function pointer to a valid value | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void ReferenceAll() |
Increment reference count on all elements | uLang/Common/Containers/SharedPointerArray.h | |
ULANG_FORCEINLINE void ReferenceRange
(
int32_t BeginIndex, |
Increment reference count on a range of elements | uLang/Common/Containers/SharedPointerArray.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULANG_FORCEINLINEPointerType operator[]
(
int32_t Index |
Array bracket operator. Returns shared pointer to element at given index. | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG & operator+=
(
const TSPtrArrayG& Other |
Appends the specified array to this array. Cannot append to self. | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG & operator+=
(
TSPtrArrayG&& Other |
Appends the specified array to this array. Cannot append to self.Move semantics version. | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG & operator=
(
const TSPtrArrayG& Other |
Copying assignment operator. | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG & operator=
(
TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... >&& ... |
Implicitly casting move assignment operator. | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG & operator=
(
TSPtrArrayG&& Other |
Move assignment operator. | uLang/Common/Containers/SharedPointerArray.h | |
TSPtrArrayG & operator=
(
const TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType...... |
Implicitly casting copying assignment-ish operator. | uLang/Common/Containers/SharedPointerArray.h |