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