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

#include <Array.h>

Public Types

using ElementType = InElementType
 
using ElementAllocatorType = InElementAllocatorType
 

Public Member Functions

ULANG_FORCEINLINE TArrayG (RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TArrayG (const typename ElementAllocatorType::RawAllocatorType &RawAllocator)
 
ULANG_FORCEINLINE TArrayG (const ElementType *Ptr, int32_t Count, RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TArrayG (int32_t Count, const ElementType &Value=ElementType(), RawAllocatorArgsType &&... RawAllocatorArgs)
 
 TArrayG (std::initializer_list< InElementType > InitList, RawAllocatorArgsType &&... RawAllocatorArgs)
 
template<typename OtherElementType >
 TArrayG (std::initializer_list< OtherElementType > InitList, RawAllocatorArgsType &&... RawAllocatorArgs)
 
template<typename OtherElementType , typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
ULANG_FORCEINLINE TArrayG (const TArrayG< OtherElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &Other, RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TArrayG (const TArrayG &Other)
 
ULANG_FORCEINLINE TArrayG (const TArrayG &Other, int32_t ExtraSlack)
 
TArrayGoperator= (const TArrayG &Other)
 
ULANG_FORCEINLINE TArrayG (TArrayG &&Other)
 
 TArrayG (TArrayG &&Other, int32_t ExtraSlack)
 
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
ULANG_FORCEINLINE TArrayG (TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&Other)
 
TArrayGoperator= (TArrayG &&Other)
 
 ~TArrayG ()
 
ULANG_FORCEINLINE ElementTypeGetData ()
 
ULANG_FORCEINLINE const ElementTypeGetData () const
 
ULANG_FORCEINLINE uint32_t GetTypeSize () const
 
ULANG_FORCEINLINE uint32_t GetAllocatedSize (void) const
 
ULANG_FORCEINLINE int32_t GetSlack () const
 
ULANG_FORCEINLINE void CheckInvariants () const
 
ULANG_FORCEINLINE void RangeCheck (int32_t Index) const
 
ULANG_FORCEINLINE bool IsValidIndex (int32_t Index) const
 
ULANG_FORCEINLINE int32_t Num () const
 
ULANG_FORCEINLINE int32_t Max () const
 
ULANG_FORCEINLINE const ElementAllocatorType::RawAllocatorType & GetRawAllocator () const
 
ULANG_FORCEINLINE bool IsEmpty () const
 
ULANG_FORCEINLINE bool IsFilled () const
 
ULANG_FORCEINLINE ElementTypeoperator[] (int32_t Index)
 
ULANG_FORCEINLINE const ElementTypeoperator[] (int32_t Index) const
 
ULANG_FORCEINLINE ElementType Pop (bool bAllowShrinking=true)
 
ULANG_FORCEINLINE void Push (ElementType &&Item)
 
ULANG_FORCEINLINE void Push (const ElementType &Item)
 
ULANG_FORCEINLINE ElementTypeTop ()
 
ULANG_FORCEINLINE const ElementTypeTop () const
 
ULANG_FORCEINLINE ElementTypeLast (int32_t IndexFromTheEnd=0)
 
ULANG_FORCEINLINE const ElementTypeLast (int32_t IndexFromTheEnd=0) const
 
ULANG_FORCEINLINE void Shrink ()
 
ULANG_FORCEINLINE bool Find (const ElementType &Item, int32_t &Index) const
 
int32_t Find (const ElementType &Item) const
 
ULANG_FORCEINLINE bool FindLast (const ElementType &Item, int32_t &Index) const
 
int32_t FindLast (const ElementType &Item) const
 
template<typename Predicate >
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 const ElementTypeFindByKey (const KeyType &Key) const
 
template<typename KeyType >
ElementTypeFindByKey (const KeyType &Key)
 
template<typename Predicate >
ULANG_FORCEINLINE const ElementTypeFindByPredicate (Predicate Pred) const
 
template<typename Predicate >
ElementTypeFindByPredicate (Predicate Pred)
 
template<typename Predicate >
TArrayG FilterByPredicate (Predicate Pred) const
 
template<typename ComparisonType >
bool Contains (const ComparisonType &Item) const
 
template<typename Predicate >
ULANG_FORCEINLINE bool ContainsByPredicate (Predicate Pred) const
 
bool operator== (const TArrayG &OtherArray) const
 
ULANG_FORCEINLINE bool operator!= (const TArrayG &OtherArray) const
 
ULANG_FORCEINLINE int32_t AddUninitialized (int32_t Count=1)
 
void InsertUninitialized (int32_t Index, int32_t Count=1)
 
void InsertZeroed (int32_t Index, int32_t Count=1)
 
ElementTypeInsertZeroed_GetRef (int32_t Index)
 
void InsertDefaulted (int32_t Index, int32_t Count=1)
 
ElementTypeInsertDefaulted_GetRef (int32_t Index)
 
int32_t Insert (std::initializer_list< ElementType > InitList, const int32_t InIndex)
 
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
int32_t Insert (const TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &Items, const int32_t InIndex)
 
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
int32_t Insert (TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&Items, const int32_t InIndex)
 
int32_t Insert (const ElementType *Ptr, int32_t Count, int32_t Index)
 
ULANG_FORCEINLINE void CheckAddress (void const *Addr) const
 
int32_t Insert (ElementType &&Item, int32_t Index)
 
int32_t Insert (const ElementType &Item, int32_t Index)
 
ElementTypeInsert_GetRef (ElementType &&Item, int32_t Index)
 
ElementTypeInsert_GetRef (const ElementType &Item, int32_t Index)
 
ULANG_FORCEINLINE void RemoveAt (int32_t Index)
 
template<typename CountType >
ULANG_FORCEINLINE void RemoveAt (int32_t Index, CountType Count, bool bAllowShrinking=true)
 
ULANG_FORCEINLINE void RemoveAtSwap (int32_t Index)
 
template<typename CountType >
ULANG_FORCEINLINE void RemoveAtSwap (int32_t Index, CountType Count, bool bAllowShrinking=true)
 
int32_t Replace (const ElementType &OldItem, const ElementType &NewItem)
 
void Reset (int32_t NewSize=0)
 
void Empty (int32_t Slack=0)
 
void SetNum (int32_t NewNum, bool bAllowShrinking=true)
 
void SetNumZeroed (int32_t NewNum, bool bAllowShrinking=true)
 
void SetNumUninitialized (int32_t NewNum, bool bAllowShrinking=true)
 
void SetNumUnsafeInternal (int32_t NewNum)
 
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
void Append (const TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &Source)
 
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
void Append (TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&Source)
 
void Append (const ElementType *Ptr, int32_t Count)
 
ULANG_FORCEINLINE void Append (std::initializer_list< ElementType > InitList)
 
TArrayGoperator+= (TArrayG &&Other)
 
TArrayGoperator+= (const TArrayG &Other)
 
TArrayGoperator+= (std::initializer_list< ElementType > InitList)
 
template<typename... ArgsType>
ULANG_FORCEINLINE int32_t Emplace (ArgsType &&... Args)
 
template<typename... ArgsType>
ULANG_FORCEINLINE ElementTypeEmplace_GetRef (ArgsType &&... Args)
 
template<typename... ArgsType>
ULANG_FORCEINLINE void EmplaceAt (int32_t Index, ArgsType &&... Args)
 
template<typename... ArgsType>
ULANG_FORCEINLINE ElementTypeEmplaceAt_GetRef (int32_t Index, ArgsType &&... Args)
 
ULANG_FORCEINLINE int32_t Add (ElementType &&Item)
 
ULANG_FORCEINLINE int32_t Add (const ElementType &Item)
 
ULANG_FORCEINLINE ElementTypeAdd_GetRef (ElementType &&Item)
 
ULANG_FORCEINLINE ElementTypeAdd_GetRef (const ElementType &Item)
 
int32_t AddZeroed (int32_t Count=1)
 
ElementTypeAddZeroed_GetRef ()
 
int32_t AddDefaulted (int32_t Count=1)
 
ElementTypeAddDefaulted_GetRef ()
 
ULANG_FORCEINLINE int32_t AddUnique (ElementType &&Item)
 
ULANG_FORCEINLINE int32_t AddUnique (const ElementType &Item)
 
ULANG_FORCEINLINE void Reserve (int32_t Number)
 
void Init (const ElementType &Element, int32_t Number)
 
int32_t RemoveSingle (const ElementType &Item)
 
template<typename OtherElementType >
int32_t Remove (const OtherElementType &Item)
 
template<class PREDICATE_CLASS >
int32_t RemoveAll (const PREDICATE_CLASS &Predicate)
 
template<class PREDICATE_CLASS >
void RemoveAllSwap (const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true)
 
int32_t RemoveSingleSwap (const ElementType &Item, bool bAllowShrinking=true)
 
int32_t RemoveSwap (const ElementType &Item)
 
ULANG_FORCEINLINE ElementTypebegin ()
 
ULANG_FORCEINLINE const ElementTypebegin () const
 
ULANG_FORCEINLINE ElementTypeend ()
 
ULANG_FORCEINLINE const ElementTypeend () const
 
void Sort ()
 
template<class PredicateType >
void Sort (const PredicateType &Predicate)
 
template<class PredicateType >
void StableSort (const PredicateType &Predicate)
 
void RemoveSuccessiveDuplicates ()
 

Protected Types

using ElementStorageType = typename TChooseClass< ElementAllocatorType::NeedsElementType, typename ElementAllocatorType::template ForElementType< ElementType >, typename ElementAllocatorType::ForAnyElementType >::Result
 

Protected Attributes

ElementStorageType _ElementStorage
 
int32_t _ArrayNum
 
int32_t _ArrayMax
 

Friends

template<typename OtherElementType , typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
class TArrayG
 

Detailed Description

template<typename InElementType, typename InElementAllocatorType, typename... RawAllocatorArgsType>
class uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >

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 TArrayG 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.

Member Typedef Documentation

◆ ElementAllocatorType

◆ ElementStorageType

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
using uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::ElementStorageType = typename TChooseClass< ElementAllocatorType::NeedsElementType, typename ElementAllocatorType::template ForElementType<ElementType>, typename ElementAllocatorType::ForAnyElementType >::Result
protected

◆ ElementType

Constructor & Destructor Documentation

◆ TArrayG() [1/12]

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

Constructor with given raw allocator arguments (none required for heap allocator).

◆ TArrayG() [2/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( const typename ElementAllocatorType::RawAllocatorType &  RawAllocator)
inline

Constructor with given raw allocator.

◆ TArrayG() [3/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( const ElementType Ptr,
int32_t  Count,
RawAllocatorArgsType &&...  RawAllocatorArgs 
)
inline

Constructor from a raw array of elements.

Parameters
PtrA pointer to an array of elements to copy.
CountThe number of elements to copy from Ptr.
See also
Append

◆ TArrayG() [4/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( int32_t  Count,
const ElementType Value = ElementType(),
RawAllocatorArgsType &&...  RawAllocatorArgs 
)
inline

◆ TArrayG() [5/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( std::initializer_list< InElementType InitList,
RawAllocatorArgsType &&...  RawAllocatorArgs 
)
inline

Initializer list constructor

◆ TArrayG() [6/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( std::initializer_list< OtherElementType InitList,
RawAllocatorArgsType &&...  RawAllocatorArgs 
)
inline

◆ TArrayG() [7/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementType , typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
ULANG_FORCEINLINE uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( const TArrayG< OtherElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &  Other,
RawAllocatorArgsType &&...  RawAllocatorArgs 
)
inlineexplicit

Copy constructor with changed allocator. Use the common routine to perform the copy.

Parameters
OtherThe source array to copy.

◆ TArrayG() [8/12]

Copy constructor. Use the common routine to perform the copy.

Parameters
OtherThe source array to copy.

◆ TArrayG() [9/12]

Copy constructor. Use the common routine to perform the copy.

Parameters
OtherThe source array to copy.
ExtraSlackTells how much extra memory should be preallocated at the end of the array in the number of elements.

◆ TArrayG() [10/12]

Move constructor.

Parameters
OtherArray to move from.

◆ TArrayG() [11/12]

Move constructor.

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

◆ TArrayG() [12/12]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
ULANG_FORCEINLINE uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::TArrayG ( TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&  Other)
inlineexplicit

Move constructor.

Parameters
OtherArray to move from.

◆ ~TArrayG()

Destructor.

Member Function Documentation

◆ Add() [1/2]

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

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

◆ Add() [2/2]

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

◆ Add_GetRef() [1/2]

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

Parameters
ItemThe item to add
Returns
A reference to the newly-inserted element.
See also
AddDefaulted_GetRef, AddUnique_GetRef, AddZeroed_GetRef, Insert_GetRef

◆ Add_GetRef() [2/2]

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
A reference to the newly-inserted element.
See also
AddDefaulted_GetRef, AddUnique_GetRef, AddZeroed_GetRef, Insert_GetRef

◆ AddDefaulted()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::AddDefaulted ( 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 default-constructed.

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

◆ AddDefaulted_GetRef()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::AddDefaulted_GetRef ( )
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.

Returns
A reference to the newly-inserted element.
See also
Add_GetRef, AddZeroed_GetRef, AddUnique_GetRef, Insert_GetRef

◆ AddUninitialized()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::AddUninitialized ( int32_t  Count = 1)
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.

Parameters
CountNumber of elements to add.
Returns
Number of elements in array before addition.

◆ AddUnique() [1/2]

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

◆ AddUnique() [2/2]

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

Move semantics version.

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

◆ AddZeroed()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, 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

◆ AddZeroed_GetRef()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::AddZeroed_GetRef ( )
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.

Returns
A reference to the newly-inserted element.
See also
Add_GetRef, AddDefaulted_GetRef, AddUnique_GetRef, Insert_GetRef

◆ Append() [1/4]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Append ( const ElementType Ptr,
int32_t  Count 
)
inline

Adds a raw array of elements to the end of the TArrayG.

Parameters
PtrA pointer to an array of elements to add.
CountThe number of elements to insert from Ptr.
See also
Add, Insert

◆ Append() [2/4]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Append ( const TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &  Source)
inline

Appends the specified array to this array.

Allocator changing version.

Parameters
SourceThe array to append.
See also
Add, Insert

◆ Append() [3/4]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Append ( std::initializer_list< ElementType InitList)
inline

Adds an initializer list of elements to the end of the TArrayG.

Parameters
InitListThe initializer list of elements to add.
See also
Add, Insert

◆ Append() [4/4]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Append ( TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&  Source)
inline

Appends the specified array to this array.

Parameters
SourceThe array to append.
See also
Add, Insert

◆ begin() [1/2]

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

◆ begin() [2/2]

◆ CheckAddress()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::CheckAddress ( void const *  Addr) const
inline

Checks that the specified address is not part of an element within the container. Used for implementations to ULANG_ASSERTF that reference arguments aren't going to be invalidated by possible reallocation.

Parameters
AddrThe address to check.
See also
Add, Remove

◆ CheckInvariants()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::CheckInvariants ( ) const
inline

Checks array invariants: if array size is greater than zero and less than maximum.

◆ Contains()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
bool uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Contains ( const ComparisonType Item) const
inline

Checks if this array contains the element.

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

◆ ContainsByPredicate()

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

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

Parameters
Predicateto use
Returns
True if found. False otherwise.
See also
Contains, Find

◆ Emplace()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... ArgsType>
ULANG_FORCEINLINE int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Emplace ( ArgsType &&...  Args)
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

◆ Emplace_GetRef()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... ArgsType>
ULANG_FORCEINLINE ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Emplace_GetRef ( ArgsType &&...  Args)
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
A reference to the newly-inserted element.

◆ EmplaceAt()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... ArgsType>
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::EmplaceAt ( int32_t  Index,
ArgsType &&...  Args 
)
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.

◆ EmplaceAt_GetRef()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... ArgsType>
ULANG_FORCEINLINE ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::EmplaceAt_GetRef ( int32_t  Index,
ArgsType &&...  Args 
)
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.
Returns
A reference to the newly-inserted element.

◆ Empty()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, 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]

◆ FilterByPredicate()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
TArrayG uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::FilterByPredicate ( Predicate  Pred) const
inline

Filters the elements in the array based on a predicate functor.

Parameters
PredThe functor to apply to each element.
Returns
TArrayG with the same type as this object which contains the subset of elements for which the functor returns true.
See also
FindByPredicate, ContainsByPredicate

◆ Find() [1/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Find ( const ElementType Item) const
inline

Finds element within the array.

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

◆ Find() [2/2]

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

Finds element within the array.

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

◆ FindByKey() [1/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename KeyType >
ElementType * uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::FindByKey ( const KeyType &  Key)
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

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

◆ FindByKey() [2/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename KeyType >
ULANG_FORCEINLINE const ElementType * uLang::TArrayG< InElementType, 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() [1/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
ElementType * uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::FindByPredicate ( Predicate  Pred)
inline

Finds an element which matches a predicate functor.

Parameters
PredThe functor to apply to each element. true, or nullptr if none is found.
See also
FilterByPredicate, ContainsByPredicate

◆ FindByPredicate() [2/2]

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

Finds an element which matches a predicate functor.

Parameters
PredThe functor to apply to each 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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::FindLast ( const ElementType Item) const
inline

Finds element within the array starting from the end.

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

◆ FindLast() [2/2]

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

Finds element within the array starting from the end.

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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
ULANG_FORCEINLINE int32_t uLang::TArrayG< InElementType, 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 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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
int32_t uLang::TArrayG< InElementType, 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 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.

◆ GetAllocatedSize()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE uint32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::GetAllocatedSize ( void  ) const
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.

Returns
Number of bytes allocated by this container.

◆ GetData() [1/2]

Helper function for returning a typed pointer to the first array entry.

Returns
Pointer to first array entry or nullptr if ArrayMax == 0.

◆ GetData() [2/2]

Helper function for returning a typed pointer to the first array entry.

Returns
Pointer to first array entry or nullptr if ArrayMax == 0.

◆ GetRawAllocator()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE const ElementAllocatorType::RawAllocatorType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::GetRawAllocator ( ) const
inline

Accesses the raw allocator.

◆ GetSlack()

Returns the amount of slack in this array in elements.

See also
Num, Shrink

◆ GetTypeSize()

Helper function returning the size of the inner type.

Returns
Size in bytes of array type.

◆ IndexOfByKey()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename KeyType >
int32_t uLang::TArrayG< InElementType, 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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename Predicate >
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::IndexOfByPredicate ( Predicate  Pred) const
inline

Finds an item by predicate.

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

◆ Init()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Init ( const ElementType Element,
int32_t  Number 
)
inline

Sets the size of the array, filling it with the given element.

Parameters
ElementThe element to fill array with.
NumberThe number of elements that the array should be able to contain after allocation.

◆ Insert() [1/6]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert ( const ElementType 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/6]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert ( const ElementType Ptr,
int32_t  Count,
int32_t  Index 
)
inline

Inserts a raw array of elements at a particular index in the TArrayG.

Parameters
PtrA pointer to an array of elements to add.
CountThe number of elements to insert from Ptr.
IndexThe index to insert the elements at.
Returns
The index of the first element inserted.
See also
Add, Remove

◆ Insert() [3/6]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert ( const TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &  Items,
const int32_t  InIndex 
)
inline

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.

◆ Insert() [4/6]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert ( ElementType &&  Item,
int32_t  Index 
)
inline

Inserts a given element into the array at given location. Move semantics version.

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() [5/6]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert ( std::initializer_list< ElementType InitList,
const int32_t  InIndex 
)
inline

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.

◆ Insert() [6/6]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert ( TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&  Items,
const int32_t  InIndex 
)
inline

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.

◆ Insert_GetRef() [1/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert_GetRef ( const ElementType 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 element.
Returns
A reference to the newly-inserted element.
See also
Add, Remove

◆ Insert_GetRef() [2/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Insert_GetRef ( ElementType &&  Item,
int32_t  Index 
)
inline

Inserts a given element into the array at given location. Move semantics version.

Parameters
ItemThe element to insert.
IndexTells where to insert the new element.
Returns
A reference to the newly-inserted element.
See also
Add, Remove

◆ InsertDefaulted()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::InsertDefaulted ( int32_t  Index,
int32_t  Count = 1 
)
inline

Inserts a given number of default-constructed elements into the array at a given location.

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

◆ InsertDefaulted_GetRef()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::InsertDefaulted_GetRef ( int32_t  Index)
inline

Inserts a default-constructed element into the array at a given location.

Parameters
IndexTells where to insert the new element.
Returns
A reference to the newly-inserted element.
See also
Insert_GetRef, InsertZeroed_GetRef

◆ InsertUninitialized()

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

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

◆ InsertZeroed()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, 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

◆ InsertZeroed_GetRef()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::InsertZeroed_GetRef ( int32_t  Index)
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.

Parameters
IndexTells where to insert the new element.
Returns
A reference to the newly-inserted element.
See also
Insert_GetRef, InsertDefaulted_GetRef

◆ 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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TArrayG< InElementType, 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() [1/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Last ( int32_t  IndexFromTheEnd = 0)
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.

◆ Last() [2/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE const ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Last ( int32_t  IndexFromTheEnd = 0) const
inline

Returns n-th last element from the array.

Const version of the above.

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!=()

Inequality operator.

Parameters
OtherArrayArray to compare.
Returns
True if this array is NOT the same as OtherArray. False otherwise.

◆ operator+=() [1/3]

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

Parameters
OtherThe array to append.

◆ operator+=() [2/3]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
TArrayG & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::operator+= ( std::initializer_list< ElementType InitList)
inline

Appends the specified initializer list to this array.

Parameters
InitListThe initializer list to append.

◆ operator+=() [3/3]

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

Move semantics version.

Parameters
OtherThe array to append.

◆ operator=() [1/2]

Assignment operator. First deletes all currently contained elements and then copies from other array.

Parameters
OtherThe source array to assign from.

◆ operator=() [2/2]

Move assignment operator.

Parameters
OtherArray to assign and move from.

◆ operator==()

Equality operator.

Parameters
OtherArrayArray to compare.
Returns
True if this array is the same as OtherArray. False otherwise.

◆ operator[]() [1/2]

Array bracket operator. Returns reference to element at give index.

Returns
Reference to indexed element.

◆ operator[]() [2/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE const ElementType & uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::operator[] ( int32_t  Index) const
inline

Array bracket operator. Returns reference to element at give index.

Const version of the above.

Returns
Reference to indexed element.

◆ Pop()

Pops element from the array.

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

◆ Push() [1/2]

Pushes element into the array.

Const ref version of the above.

Parameters
ItemItem to push.
See also
Pop, Top

◆ Push() [2/2]

Pushes element into the array.

Parameters
ItemItem to push.

◆ RangeCheck()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RangeCheck ( int32_t  Index) const
inline

Checks if index is in array range.

Parameters
IndexIndex to check.

◆ Remove()

Removes as many instances of Item as there are in the array, maintaining order but not indices.

Parameters
ItemItem to remove from array.
Returns
Number of removed elements.
See also
Add, Insert, RemoveAll, RemoveAllSwap, RemoveSingle, RemoveSwap

◆ RemoveAll()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class PREDICATE_CLASS >
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RemoveAll ( const PREDICATE_CLASS Predicate)
inline

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

Parameters
PredicatePredicate class instance
Returns
Number of removed elements.
See also
Add, Insert, RemoveAllSwap, RemoveSingle, RemoveSwap

◆ RemoveAllSwap()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class PREDICATE_CLASS >
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RemoveAllSwap ( const PREDICATE_CLASS Predicate,
bool  bAllowShrinking = true 
)
inline

Remove all instances that match the predicate

Parameters
PredicatePredicate class instance
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.
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.

◆ RemoveAt() [2/2]

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename CountType >
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, 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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename CountType >
ULANG_FORCEINLINE void uLang::TArrayG< InElementType, 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.

◆ RemoveSingle()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RemoveSingle ( const ElementType Item)
inline

Removes the first occurrence of the specified item in the array, maintaining order but not indices.

Parameters
ItemThe item to remove.
Returns
The number of items removed. For RemoveSingleItem, this is always either 0 or 1.
See also
Add, Insert, Remove, RemoveAll, RemoveAllSwap

◆ RemoveSingleSwap()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RemoveSingleSwap ( const ElementType Item,
bool  bAllowShrinking = true 
)
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

Parameters
ItemThe item to remove
Returns
The number of items removed. For RemoveSingleItem, this is always either 0 or 1.
See also
Add, Insert, Remove, RemoveAll, RemoveAllSwap, RemoveSwap

◆ RemoveSuccessiveDuplicates()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RemoveSuccessiveDuplicates ( )
inline

Remove successive duplicates. Assumes that elements of the array have ==.

◆ RemoveSwap()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::RemoveSwap ( const ElementType Item)
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.

Returns
Number of elements removed.
See also
Add, Insert, Remove, RemoveAll, RemoveAllSwap

◆ Replace()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::Replace ( const ElementType OldItem,
const ElementType NewItem 
)
inline

Replaces specified element with the supplied element.

Parameters
OldItemThe element to replace.
NewItemThe element to replace with.
Returns
Location at which the replace was done.
See also
Add, Remove, Insert

◆ 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 , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, 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.

◆ SetNum()

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

Resizes array to given number of elements.

Parameters
NewNumNew size of the array.
bAllowShrinkingTell if this function can shrink the memory in-use if suitable.

◆ SetNumUninitialized()

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

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

Parameters
NewNumNew size of the array.

◆ SetNumUnsafeInternal()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::SetNumUnsafeInternal ( int32_t  NewNum)
inline

Does nothing except setting the new number of elements in the array. Does not destruct items, does not de-allocate memory.

Parameters
NewNumNew number of elements in the array, must be <= the current number of elements in the array.

◆ SetNumZeroed()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
void uLang::TArrayG< InElementType, 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 memory to smallest possible to store elements currently in it.

See also
Slack

◆ Sort() [1/2]

Sorts the array assuming < operator is defined for the item type.

Note
: If your array contains raw pointers, they will be automatically dereferenced during sorting. Therefore, your array will be sorted by the values being pointed to, rather than the pointers' values. If this is not desirable, please use Algo::Sort(MyArray) instead. The auto-dereferencing behavior does not occur with smart pointers.

◆ Sort() [2/2]

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

Sorts the array using user define predicate class.

Parameters
PredicatePredicate instance or lambda.
Note
: If your array contains raw pointers, they will be automatically dereferenced during sorting. Therefore, your predicate will be passed references rather than pointers. If this is not desirable, please use Algo::Sort(MyArray, Predicate) instead. The auto-dereferencing behavior does not occur with smart pointers.

◆ StableSort()

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<class PredicateType >
void uLang::TArrayG< InElementType, InElementAllocatorType, RawAllocatorArgsType >::StableSort ( const PredicateType Predicate)
inline

◆ Top() [1/2]

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

Returns
Reference to the top element.
See also
Pop, Push

◆ Top() [2/2]

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

Const version of the above.

Returns
Reference to the top element.
See also
Pop, Push

Friends And Related Symbol Documentation

◆ TArrayG

template<typename InElementType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementType , typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
friend class TArrayG
friend

Member Data Documentation

◆ _ArrayMax

◆ _ArrayNum

◆ _ElementStorage


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