UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType > Class Template Reference

#include <UniquePointerArray.h>

+ Inheritance diagram for uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >:

Public Types

using ElementType = InElementType
 
using ElementAllocatorType = InElementAllocatorType
 
using PointerType = TUPtrG< ElementType, AllowNull, typename InElementAllocatorType::RawAllocatorType, RawAllocatorArgsType... >
 
using PointerStorageType = TArrayG< ElementType *, InElementAllocatorType, RawAllocatorArgsType... >
 

Public Member Functions

ULANG_FORCEINLINE TUPtrArrayG (RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TUPtrArrayG (TUPtrArrayG &&Other)
 
 TUPtrArrayG (TUPtrArrayG &&Other, int32_t ExtraSlack)
 
TUPtrArrayGoperator= (TUPtrArrayG &&Other)
 
 ~TUPtrArrayG ()
 
ULANG_FORCEINLINE int32_t GetSlack () const
 
ULANG_FORCEINLINE bool IsValidIndex (int32_t Index) const
 
ULANG_FORCEINLINE int32_t Num () const
 
ULANG_FORCEINLINE int32_t Max () const
 
ULANG_FORCEINLINE bool IsEmpty () const
 
ULANG_FORCEINLINE bool IsFilled () const
 
ULANG_FORCEINLINE ElementTypeoperator[] (int32_t Index) const
 
ULANG_FORCEINLINE PointerType Pop (bool bAllowShrinking=true)
 
ULANG_FORCEINLINE void Push (PointerType &&Item)
 
ULANG_FORCEINLINE ElementTypeTop () const
 
ULANG_FORCEINLINE ElementTypeLast (int32_t IndexFromTheEnd=0) const
 
ULANG_FORCEINLINE void Shrink ()
 
ULANG_FORCEINLINE bool Find (ElementType *Item, int32_t &Index) const
 
ULANG_FORCEINLINE int32_t Find (ElementType *Item) const
 
ULANG_FORCEINLINE bool FindLast (const PointerType &Item, int32_t &Index) const
 
ULANG_FORCEINLINE int32_t FindLast (const PointerType &Item) const
 
template<typename Predicate >
ULANG_FORCEINLINE int32_t FindLastByPredicate (Predicate Pred, int32_t Count) const
 
template<typename Predicate >
ULANG_FORCEINLINE int32_t FindLastByPredicate (Predicate Pred) const
 
template<typename KeyType >
int32_t IndexOfByKey (const KeyType &Key) const
 
template<typename Predicate >
int32_t IndexOfByPredicate (Predicate Pred) const
 
template<typename KeyType >
ULANG_FORCEINLINE ElementTypeFindByKey (const KeyType &Key) const
 
template<typename Predicate >
ULANG_FORCEINLINE ElementTypeFindByPredicate (Predicate Pred) const
 
bool Contains (const ElementType *Pointer) const
 
template<typename ComparisonType >
bool ContainsByKey (const ComparisonType &Key) const
 
template<typename Predicate >
ULANG_FORCEINLINE bool ContainsByPredicate (Predicate Pred) const
 
void InsertZeroed (int32_t Index, int32_t Count=1)
 
int32_t Insert (TUPtrArrayG &&Items, const int32_t InIndex)
 
int32_t Insert (PointerType &&Item, int32_t Index)
 
ULANG_FORCEINLINE PointerType RemoveAt (int32_t Index)
 
template<typename CountType >
ULANG_FORCEINLINE void RemoveAt (int32_t Index, CountType Count, bool bAllowShrinking=true)
 
ULANG_FORCEINLINE PointerType RemoveAtSwap (int32_t Index)
 
template<typename CountType >
ULANG_FORCEINLINE void RemoveAtSwap (int32_t Index, CountType Count, bool bAllowShrinking=true)
 
int32_t ReplaceAt (PointerType &&Item, int32_t Index)
 
void Reset (int32_t NewSize=0)
 
void Empty (int32_t Slack=0)
 
void SetNumZeroed (int32_t NewNum, bool bAllowShrinking=true)
 
void Append (TUPtrArrayG &&Source)
 
TUPtrArrayGoperator+= (TUPtrArrayG &&Other)
 
template<typename... CtorArgsType>
ULANG_FORCEINLINE int32_t AddNew (CtorArgsType &&... CtorArgs)
 
template<typename... CtorArgsType>
ULANG_FORCEINLINE void InsertNew (int32_t Index, CtorArgsType &&... CtorArgs)
 
ULANG_FORCEINLINE int32_t Add (PointerType &&Item)
 
int32_t AddZeroed (int32_t Count=1)
 
ULANG_FORCEINLINE int32_t AddUnique (PointerType &&Item)
 
ULANG_FORCEINLINE void Reserve (int32_t Number)
 
template<typename Predicate >
int32_t RemoveAll (const Predicate &Pred)
 
template<class Predicate >
void RemoveAllSwap (const Predicate &Pred, bool bAllowShrinking=true)
 
void Sort ()
 
template<class PredicateType >
void Sort (const PredicateType &Predicate)
 
template<class OtherElementType , bool OtherAllowNull = AllowNull, typename = typename TEnableIf<TPointerIsStaticCastableFromTo<OtherElementType, ElementType>::Value && (AllowNull == OtherAllowNull || OtherAllowNull)>::Type>
ULANG_FORCEINLINE TUPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & As ()
 
template<class OtherElementType , bool OtherAllowNull = AllowNull, typename = typename TEnableIf<TPointerIsStaticCastableFromTo<OtherElementType, ElementType>::Value && (AllowNull == OtherAllowNull || OtherAllowNull)>::Type>
ULANG_FORCEINLINE const TUPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & As () const
 
ULANG_FORCEINLINE ElementType ** begin ()
 
ULANG_FORCEINLINE ElementType *const * begin () const
 
ULANG_FORCEINLINE ElementType ** end ()
 
ULANG_FORCEINLINE ElementType *const * end () const
 

Protected Member Functions

ULANG_FORCEINLINE void Delete (int32_t Index)
 
ULANG_FORCEINLINE void DeleteRange (int32_t BeginIndex, int32_t EndIndex)
 
ULANG_FORCEINLINE void DeleteAll ()
 

Protected Attributes

PointerStorageType _PointerStorage
 

Friends

template<typename OtherElementType , bool OtherAllowNull, typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
class TUPtrArrayG
 

Detailed Description

template<typename InElementType, bool AllowNull, typename InElementAllocatorType, typename... RawAllocatorArgsType>
class uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >

Templated dynamic array of unique pointers to elements

Member Typedef Documentation

◆ ElementAllocatorType

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
using uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::ElementAllocatorType = InElementAllocatorType

◆ ElementType

◆ PointerStorageType

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
using uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::PointerStorageType = TArrayG<ElementType *, InElementAllocatorType, RawAllocatorArgsType...>

◆ PointerType

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
using uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::PointerType = TUPtrG<ElementType, AllowNull, typename InElementAllocatorType::RawAllocatorType, RawAllocatorArgsType...>

Constructor & Destructor Documentation

◆ TUPtrArrayG() [1/3]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::TUPtrArrayG ( RawAllocatorArgsType &&...  RawAllocatorArgs)
inline

Constructor

◆ TUPtrArrayG() [2/3]

Move constructor.

Parameters
OtherArray to move from.

◆ TUPtrArrayG() [3/3]

Move constructor.

Parameters
OtherArray to move from.
ExtraSlackTells how much extra pointer memory should be preallocated at the end of the array in the number of elements.

◆ ~TUPtrArrayG()

Destructor.

Member Function Documentation

◆ Add()

Adds a new item to the end of the array, possibly reallocating the whole array to fit.

Move semantics version.

Parameters
ItemThe item to add
Returns
Index to the new item
See also
AddDefaulted, AddUnique, AddZeroed, Append, Insert

◆ AddNew()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... CtorArgsType>
ULANG_FORCEINLINE int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::AddNew ( CtorArgsType &&...  CtorArgs)
inline

Constructs a new item at the end of the array, possibly reallocating the whole array to fit.

Parameters
ArgsThe arguments to forward to the constructor of the new item.
Returns
Index to the new item

◆ AddUnique()

Adds unique element to array if it doesn't exist.

Parameters
ArgsItem to add.
Returns
Index of the element in the array.
See also
Add, AddDefaulted, AddZeroed, Append, Insert

◆ AddZeroed()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::AddZeroed ( int32_t  Count = 1)
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.

Parameters
CountThe number of new items to add.
Returns
Index to the first of the new items.
See also
Add, AddDefaulted, AddUnique, Append, Insert

◆ Append()

Appends the specified array to this array.

Parameters
SourceThe array to append.
See also
Add, Insert

◆ As() [1/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class OtherElementType , bool OtherAllowNull = AllowNull, typename = typename TEnableIf<TPointerIsStaticCastableFromTo<OtherElementType, ElementType>::Value && (AllowNull == OtherAllowNull || OtherAllowNull)>::Type>
ULANG_FORCEINLINE TUPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::As ( )
inline

Casts TUPtrArray<T>& -> TUPtrArray& if T is castable to U.

◆ As() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class OtherElementType , bool OtherAllowNull = AllowNull, typename = typename TEnableIf<TPointerIsStaticCastableFromTo<OtherElementType, ElementType>::Value && (AllowNull == OtherAllowNull || OtherAllowNull)>::Type>
ULANG_FORCEINLINE const TUPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::As ( ) const
inline

◆ begin() [1/2]

DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.

◆ begin() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE ElementType *const * uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::begin ( ) const
inline

◆ Contains()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
bool uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Contains ( const ElementType Pointer) const
inline

Checks if this array contains the exact pointer.

Returns
True if found. False otherwise.
See also
ContainsByPredicate, FilterByPredicate, FindByPredicate

◆ ContainsByKey()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
bool uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::ContainsByKey ( const ComparisonType Key) const
inline

Checks if this array contains the element.

Returns
True if found. False otherwise.
See also
ContainsByPredicate, FilterByPredicate, FindByPredicate

◆ ContainsByPredicate()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
ULANG_FORCEINLINE bool uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::ContainsByPredicate ( Predicate  Pred) const
inline

Checks if this array contains element for which the predicate is true.

Parameters
Predicateto use, taking const pointer to array element
Returns
True if found. False otherwise.
See also
Contains, Find

◆ Delete()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Delete ( int32_t  Index)
inlineprotected

Delete a single element

◆ DeleteAll()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::DeleteAll ( )
inlineprotected

Delete all elements

◆ DeleteRange()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::DeleteRange ( int32_t  BeginIndex,
int32_t  EndIndex 
)
inlineprotected

Delete a range of elements

◆ Empty()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Empty ( int32_t  Slack = 0)
inline

Empties the array. It calls the destructors on held items if needed.

Parameters
Slack(Optional) The expected usage size after empty operation. Default is 0.

◆ end() [1/2]

◆ end() [2/2]

◆ Find() [1/2]

Finds element within the array (by address comparison).

Parameters
ItemItem to look for.
Returns
Index of the found element. IndexNone otherwise.
See also
FindLast, FindLastByPredicate

◆ Find() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Find ( ElementType Item,
int32_t Index 
) const
inline

Finds element within the array (by address comparison).

Parameters
ItemItem to look for.
IndexWill contain the found index.
Returns
True if found. False otherwise.
See also
FindLast, FindLastByPredicate

◆ FindByKey()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename KeyType >
ULANG_FORCEINLINE ElementType * uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::FindByKey ( const KeyType &  Key) const
inline

Finds an item by key (assuming the ElementType overloads operator== for the comparison).

Parameters
KeyThe key to search by.
Returns
Pointer to the first matching element, or nullptr if none is found.
See also
Find

◆ FindByPredicate()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
ULANG_FORCEINLINE ElementType * uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::FindByPredicate ( Predicate  Pred) const
inline

Finds an element which matches a predicate functor.

Parameters
PredThe functor to apply to each element, taking const pointer to array element.
Returns
Pointer to the first element for which the predicate returns true, or nullptr if none is found.
See also
FilterByPredicate, ContainsByPredicate

◆ FindLast() [1/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::FindLast ( const PointerType Item) const
inline

Finds element within the array starting from the end (by address comparison).

Parameters
ItemItem to look for.
Returns
Index of the found element. IndexNone otherwise.

◆ FindLast() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::FindLast ( const PointerType Item,
int32_t Index 
) const
inline

Finds element within the array starting from the end (by address comparison).

Parameters
ItemItem to look for.
IndexOutput parameter. Found index.
Returns
True if found. False otherwise.
See also
Find, FindLastByPredicate

◆ FindLastByPredicate() [1/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
ULANG_FORCEINLINE int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::FindLastByPredicate ( Predicate  Pred) const
inline

Searches the array for the last occurrence of an element which matches the specified predicate.

Parameters
PredPredicate taking const pointer to array element and returns true if element matches search criteria, false otherwise.
Returns
Index of the found element. IndexNone otherwise.

◆ FindLastByPredicate() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
ULANG_FORCEINLINE int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::FindLastByPredicate ( Predicate  Pred,
int32_t  Count 
) const
inline

Searches an initial subrange of the array for the last occurrence of an element which matches the specified predicate.

Parameters
PredPredicate taking const pointer to array element and returns true if element matches search criteria, false otherwise.
CountThe number of elements from the front of the array through which to search.
Returns
Index of the found element. IndexNone otherwise.

◆ GetSlack()

Returns the amount of slack in this array in elements.

See also
Num, Shrink

◆ IndexOfByKey()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename KeyType >
int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::IndexOfByKey ( const KeyType &  Key) const
inline

Finds an item by key (assuming the ElementType overloads operator== for the comparison).

Parameters
KeyThe key to search by.
Returns
Index to the first matching element, or IndexNone if none is found.

◆ IndexOfByPredicate()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::IndexOfByPredicate ( Predicate  Pred) const
inline

Finds an item by predicate.

Parameters
PredThe predicate to match, taking const pointer to array element.
Returns
Index to the first matching element, or IndexNone if none is found.

◆ Insert() [1/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Insert ( PointerType &&  Item,
int32_t  Index 
)
inline

Inserts a given element into the array at given location.

Parameters
ItemThe element to insert.
IndexTells where to insert the new elements.
Returns
Location at which the insert was done.
See also
Add, Remove

◆ Insert() [2/2]

Inserts given elements into the array at given location.

Parameters
ItemsArray of elements to insert.
InIndexTells where to insert the new elements.
Returns
Location at which the item was inserted.

◆ InsertNew()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... CtorArgsType>
ULANG_FORCEINLINE void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::InsertNew ( int32_t  Index,
CtorArgsType &&...  CtorArgs 
)
inline

Constructs a new item at a specified index, possibly reallocating the whole array to fit.

Parameters
IndexThe index to add the item at.
ArgsThe arguments to forward to the constructor of the new item.

◆ InsertZeroed()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::InsertZeroed ( int32_t  Index,
int32_t  Count = 1 
)
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.

Parameters
IndexTells where to insert the new elements.
CountNumber of elements to add.
See also
Insert, InsertUninitialized, InsertDefaulted

◆ IsEmpty()

Returns true if no elements in array

Returns
true if no elements in array or false if one or more elements.
See also
IsFull, Num

◆ IsFilled()

Returns true if any elements in array

Returns
true if one or more elements in array or false no elements.
See also
IsEmpty, Num

◆ IsValidIndex()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::IsValidIndex ( int32_t  Index) const
inline

Tests if index is valid, i.e. greater than or equal to zero, and less than the number of elements in the array.

Parameters
IndexIndex to test.
Returns
True if index is valid. False otherwise.

◆ Last()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE ElementType * uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Last ( int32_t  IndexFromTheEnd = 0) const
inline

Returns n-th last element from the array.

Parameters
IndexFromTheEnd(Optional) Index from the end of array (default = 0).
Returns
Reference to n-th last element from the array.

◆ Max()

Returns maximum number of elements in array.

Returns
Maximum number of elements in array.
See also
GetSlack

◆ Num()

Returns number of elements in array.

Returns
Number of elements in array.
See also
GetSlack

◆ operator+=()

Appends the specified array to this array. Cannot append to self.

Move semantics version.

Parameters
OtherThe array to append.

◆ operator=()

Move assignment operator.

Parameters
OtherArray to assign and move from.

◆ operator[]()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE ElementType * uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::operator[] ( int32_t  Index) const
inline

Array bracket operator. Returns naked pointer to element at given index.

◆ Pop()

Pops element from the array.

Parameters
bAllowShrinkingIf this call allows shrinking of the array during element remove.
Returns
Popped element.

◆ Push()

Pushes element into the array.

Parameters
ItemItem to push.

◆ RemoveAll()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::RemoveAll ( const Predicate &  Pred)
inline

Remove all instances that match the predicate, maintaining order but not indices Optimized to work with runs of matches/non-matches

Parameters
PredPredicate, taking const pointer to array element
Returns
Number of removed elements.
See also
Add, Insert, RemoveAllSwap, RemoveSingle, RemoveSwap

◆ RemoveAllSwap()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class Predicate >
void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::RemoveAllSwap ( const Predicate &  Pred,
bool  bAllowShrinking = true 
)
inline

Remove all instances that match the predicate

Parameters
PredPredicate, taking const pointer to array element
See also
Remove, RemoveSingle, RemoveSingleSwap, RemoveSwap

◆ RemoveAt() [1/2]

Removes an element (or elements) at given location optionally shrinking the array.

Parameters
IndexLocation in array of the element to remove.

◆ RemoveAt() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename CountType >
ULANG_FORCEINLINE void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::RemoveAt ( int32_t  Index,
CountType  Count,
bool  bAllowShrinking = true 
)
inline

Removes an element (or elements) at given location optionally shrinking the array.

Parameters
IndexLocation 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.

◆ RemoveAtSwap() [1/2]

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.

Parameters
IndexLocation 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.

◆ RemoveAtSwap() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename CountType >
ULANG_FORCEINLINE void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::RemoveAtSwap ( int32_t  Index,
CountType  Count,
bool  bAllowShrinking = 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.

Parameters
IndexLocation 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.

◆ ReplaceAt()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::ReplaceAt ( PointerType &&  Item,
int32_t  Index 
)
inline

Replaces a given element at a given location.

Parameters
ItemThe element to insert.
IndexTells where to insert the new element.
Returns
Location at which the replacement was done.
See also
Add, Remove

◆ Reserve()

Reserves memory such that the array can contain at least Number elements.

Parameters
NumberThe number of elements that the array should be able to contain after allocation.
See also
Shrink

◆ Reset()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Reset ( int32_t  NewSize = 0)
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.

Parameters
NewSizeThe expected usage size after calling this function.

◆ SetNumZeroed()

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::SetNumZeroed ( int32_t  NewNum,
bool  bAllowShrinking = true 
)
inline

Resizes array to given number of elements. New elements will be zeroed.

Parameters
NewNumNew size of the array.

◆ Shrink()

Shrinks the array's used pointer memory to smallest possible to store elements currently in it.

See also
Slack

◆ Sort() [1/2]

Sorts the array assuming < operator is defined for ElementType.

◆ Sort() [2/2]

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class PredicateType >
void uLang::TUPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType >::Sort ( const PredicateType Predicate)
inline

Sorts the array using user define predicate class.

Parameters
PredicatePredicate instance or lambda, taking const pointer to array element

◆ Top()

Returns the top element, i.e. the last one.

Returns
Naked pointer to the top element.
See also
Pop, Push

Friends And Related Symbol Documentation

◆ TUPtrArrayG

template<typename InElementType , bool AllowNull, typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementType , bool OtherAllowNull, typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
friend class TUPtrArrayG
friend

Member Data Documentation

◆ _PointerStorage


The documentation for this class was generated from the following files: