17 template <
typename FromArrayType,
typename ToArrayType>
88 ULANG_ASSERTF(Ptr !=
nullptr ||
Count == 0,
"Attempted to construct array from invalid source data.");
90 CopyToEmpty(Ptr,
Count, 0, 0);
97 ResizeForCopy(
Count, 0);
117 template <
typename OtherElementType>
132 CopyToEmpty(
Other.GetData(),
Other.Num(), 0, 0);
143 CopyToEmpty(
Other.GetData(),
Other.Num(), 0, 0);
156 CopyToEmpty(
Other.GetData(),
Other.Num(), 0, ExtraSlack);
169 ULANG_ASSERTF(
_ElementStorage.GetRawAllocator() ==
Other._ElementStorage.GetRawAllocator(),
"Currently, can only assign between arrays using the same allocator.");
186 template <
typename FromArrayType,
typename ToArrayType>
189 ToArray._ElementStorage.MoveToEmpty(
FromArray._ElementStorage);
191 ToArray ._ArrayNum =
FromArray._ArrayNum;
192 ToArray ._ArrayMax =
FromArray._ArrayMax;
207 template <
typename FromArrayType,
typename ToArrayType>
210 ToArray._ElementStorage.SetRawAllocator(
FromArray._ElementStorage.GetRawAllocator());
224 template <
typename FromArrayType,
typename ToArrayType>
229 ToArray.Reserve(ToArray._ArrayNum + ExtraSlack);
242 template <
typename FromArrayType,
typename ToArrayType>
245 ToArray._ElementStorage.SetRawAllocator(
FromArray._ElementStorage.GetRawAllocator());
257 MoveOrCopy(*
this,
Other, 0);
273 MoveOrCopyWithSlack(*
this,
Other, 0, ExtraSlack);
284 MoveOrCopy(*
this,
Other, 0);
379 if (ElementAllocatorType::RequireRangeCheck)
599 return static_cast<int32_t>(Data - Start);
632 return static_cast<int32_t>(Data - Start);
645 template <
typename Predicate>
654 return static_cast<int32_t>(Data - Start);
666 template <
typename Predicate>
679 template <
typename KeyType>
687 return static_cast<int32_t>(Data - Start);
699 template <
typename Predicate>
707 return static_cast<int32_t>(Data - Start);
721 template <
typename KeyType>
735 template <
typename KeyType>
756 template <
typename Predicate>
768 template <
typename Predicate>
790 template <
typename Predicate>
810 template <
typename ComparisonType>
830 template <
typename Predicate>
873 ULANG_ASSERTF(
Count >= 0,
"Number of elements to add to array must not be negative.");
1006 ULANG_ASSERTF((
const void*)
this != (
const void*)&Items,
"Attempted to insert array into itself.");
1026 ULANG_ASSERTF((
const void*)
this != (
const void*)&Items,
"Attempted to insert array into itself.");
1032 Items._ArrayNum = 0;
1048 ULANG_ASSERTF(Ptr !=
nullptr,
"Elements to insert must not be null.");
1172 if (bAllowShrinking)
1190 RemoveAtImpl(
Index, 1,
true);
1201 template <
typename CountType>
1232 if (bAllowShrinking)
1254 RemoveAtSwapImpl(
Index, 1,
true);
1269 template <
typename CountType>
1273 RemoveAtSwapImpl(
Index,
Count, bAllowShrinking);
1713 template <
typename ArgsType>
1813 template <
typename OtherElementType>
1830 template <
class PREDICATE_CLASS>
1845 while (ReadIndex < OriginalNum &&
NotMatch == !Predicate(
GetData()[ReadIndex]))
1866 }
while (ReadIndex < OriginalNum);
1878 template <
class PREDICATE_CLASS>
1881 for (
int32_t ItemIndex = 0; ItemIndex <
Num();)
1883 if (Predicate((*
this)[ItemIndex]))
1934 if ((*
this)[
Index] == Item)
1978 template <
class PredicateType>
1984 template <
class PredicateType>
1998 while (FromIndex <
Num())
2063 template <
typename OtherElementType>
2066 ULANG_ASSERTF(ExtraSlack >= 0,
"Array slack must be positive.");
2082 ElementAllocatorType::NeedsElementType,
2084 typename ElementAllocatorType::ForAnyElementType
2094template<
class ElementType>
2098template<
class ElementType>
2101template <
typename ElementType,
typename ElementAllocatorType,
typename...
RawAllocatorArgsType>
2107template <
typename ElementType,
typename ElementAllocatorType,
typename...
RawAllocatorArgsType>
2114template <
typename ElementType,
typename ElementAllocatorType,
typename...
RawAllocatorArgsType>
2131template <
typename T>
2135 for (
const T& Element :
Array)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FORCEINLINE uint32 ToIndex(FHairStrandsTiles::ETileType Type)
Definition HairStrandsData.h:93
#define ULANG_RESTRICT
Definition Common.h:207
#define ULANG_FORCEINLINE
Definition Common.h:188
#define ULANG_FORCENOINLINE
Definition Common.h:189
#define ULANG_ASSERTF(expr, format,...)
Definition Common.h:290
memcpy(InputBufferBase, BinkBlocksData, BinkBlocksSize)
Definition Allocator.h:35
static ULANG_FORCEINLINE constexpr T Min(const T A, const T B)
Returns lower value in a generic way.
Definition MathUtils.h:26
ULANG_FORCEINLINE void Shrink()
Definition Array.h:562
ULANG_FORCEINLINE int32_t Emplace(ArgsType &&... Args)
Definition Array.h:1527
ULANG_FORCEINLINE ElementType & Last(int32_t IndexFromTheEnd=0)
Definition Array.h:537
ULANG_FORCEINLINE bool operator!=(const TArrayG &OtherArray) const
Definition Array.h:855
ULANG_FORCEINLINE int32_t Max() const
Definition Array.h:413
ULANG_FORCEINLINE const ElementType * begin() const
Definition Array.h:1949
ElementType & AddDefaulted_GetRef()
Definition Array.h:1697
void InsertDefaulted(int32_t Index, int32_t Count=1)
Definition Array.h:957
ULANG_FORCEINLINE const ElementType * FindByPredicate(Predicate Pred) const
Definition Array.h:757
TArrayG(std::initializer_list< OtherElementType > InitList, RawAllocatorArgsType &&... RawAllocatorArgs)
Definition Array.h:118
int32_t Remove(const OtherElementType &Item)
Definition Array.h:1814
void SetNumUninitialized(int32_t NewNum, bool bAllowShrinking=true)
Definition Array.h:1377
ElementType & Insert_GetRef(ElementType &&Item, int32_t Index)
Definition Array.h:1117
ULANG_FORCEINLINE const ElementType * GetData() const
Definition Array.h:323
void RemoveSuccessiveDuplicates()
Definition Array.h:1993
InElementType ElementType
Definition Array.h:57
void SetNum(int32_t NewNum, bool bAllowShrinking=true)
Definition Array.h:1341
ULANG_FORCEINLINE void Append(std::initializer_list< ElementType > InitList)
Definition Array.h:1475
int32_t Insert(const TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &Items, const int32_t InIndex)
Definition Array.h:1004
int32_t RemoveSwap(const ElementType &Item)
Definition Array.h:1927
typename TChooseClass< ElementAllocatorType::NeedsElementType, typename ElementAllocatorType::template ForElementType< ElementType >, typename ElementAllocatorType::ForAnyElementType >::Result ElementStorageType
Definition Array.h:2085
ULANG_FORCEINLINE TArrayG(int32_t Count, const ElementType &Value=ElementType(), RawAllocatorArgsType &&... RawAllocatorArgs)
Definition Array.h:93
ElementType & AddZeroed_GetRef()
Definition Array.h:1667
ULANG_FORCEINLINE void EmplaceAt(int32_t Index, ArgsType &&... Args)
Definition Array.h:1556
ElementType & InsertZeroed_GetRef(int32_t Index)
Definition Array.h:941
ULANG_FORCEINLINE TArrayG(TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&Other)
Definition Array.h:282
void SetNumZeroed(int32_t NewNum, bool bAllowShrinking=true)
Definition Array.h:1360
TArrayG & operator+=(TArrayG &&Other)
Definition Array.h:1491
ULANG_FORCEINLINE const ElementType * FindByKey(const KeyType &Key) const
Definition Array.h:722
void SetNumUnsafeInternal(int32_t NewNum)
Definition Array.h:1393
void Empty(int32_t Slack=0)
Definition Array.h:1322
ULANG_FORCEINLINE TArrayG(const TArrayG< OtherElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &Other, RawAllocatorArgsType &&... RawAllocatorArgs)
Definition Array.h:129
ULANG_FORCEINLINE const ElementType & Top() const
Definition Array.h:526
TArrayG & operator=(TArrayG &&Other)
Definition Array.h:292
ElementType * FindByKey(const KeyType &Key)
Definition Array.h:736
TArrayG & operator=(const TArrayG &Other)
Definition Array.h:165
ULANG_FORCEINLINE bool ContainsByPredicate(Predicate Pred) const
Definition Array.h:831
ULANG_FORCEINLINE bool Find(const ElementType &Item, int32_t &Index) const
Definition Array.h:579
ULANG_FORCEINLINE const ElementType * end() const
Definition Array.h:1951
ULANG_FORCEINLINE int32_t Add(const ElementType &Item)
Definition Array.h:1600
ULANG_FORCEINLINE uint32_t GetTypeSize() const
Definition Array.h:333
ULANG_FORCEINLINE ElementType & EmplaceAt_GetRef(int32_t Index, ArgsType &&... Args)
Definition Array.h:1570
ULANG_FORCEINLINE void CheckAddress(void const *Addr) const
Definition Array.h:1064
ULANG_FORCEINLINE TArrayG(const ElementType *Ptr, int32_t Count, RawAllocatorArgsType &&... RawAllocatorArgs)
Definition Array.h:85
ULANG_FORCEINLINE ElementType & Add_GetRef(const ElementType &Item)
Definition Array.h:1628
TArrayG FilterByPredicate(Predicate Pred) const
Definition Array.h:791
ULANG_FORCEINLINE void RemoveAt(int32_t Index)
Definition Array.h:1188
int32_t Find(const ElementType &Item) const
Definition Array.h:592
void Sort(const PredicateType &Predicate)
Definition Array.h:1979
~TArrayG()
Definition Array.h:303
void RemoveAllSwap(const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true)
Definition Array.h:1879
ULANG_FORCEINLINE TArrayG(const TArrayG &Other, int32_t ExtraSlack)
Definition Array.h:153
ElementStorageType _ElementStorage
Definition Array.h:2087
int32_t Replace(const ElementType &OldItem, const ElementType &NewItem)
Definition Array.h:1284
void Append(const ElementType *Ptr, int32_t Count)
Definition Array.h:1461
ULANG_FORCEINLINE int32_t AddUninitialized(int32_t Count=1)
Definition Array.h:870
ULANG_FORCEINLINE ElementType * begin()
Definition Array.h:1948
void InsertZeroed(int32_t Index, int32_t Count=1)
Definition Array.h:921
int32_t AddZeroed(int32_t Count=1)
Definition Array.h:1646
ULANG_FORCEINLINE void Push(ElementType &&Item)
Definition Array.h:489
int32_t RemoveSingleSwap(const ElementType &Item, bool bAllowShrinking=true)
Definition Array.h:1903
int32_t Insert(const ElementType *Ptr, int32_t Count, int32_t Index)
Definition Array.h:1046
ULANG_FORCEINLINE int32_t FindLastByPredicate(Predicate Pred) const
Definition Array.h:667
void Reset(int32_t NewSize=0)
Definition Array.h:1303
void Init(const ElementType &Element, int32_t Number)
Definition Array.h:1767
int32_t _ArrayMax
Definition Array.h:2089
ULANG_FORCEINLINE void Push(const ElementType &Item)
Definition Array.h:502
ULANG_FORCEINLINE ElementType & Add_GetRef(ElementType &&Item)
Definition Array.h:1615
ULANG_FORCEINLINE bool IsEmpty() const
Definition Array.h:430
ULANG_FORCEINLINE int32_t AddUnique(const ElementType &Item)
Definition Array.h:1745
ULANG_FORCEINLINE bool IsFilled() const
Definition Array.h:441
ULANG_FORCEINLINE TArrayG(RawAllocatorArgsType &&... RawAllocatorArgs)
Definition Array.h:63
ULANG_FORCEINLINE ElementType * GetData()
Definition Array.h:313
ULANG_FORCEINLINE const ElementType & operator[](int32_t Index) const
Definition Array.h:464
ULANG_FORCEINLINE int32_t GetSlack() const
Definition Array.h:355
void StableSort(const PredicateType &Predicate)
Definition Array.h:1985
int32_t FindLast(const ElementType &Item) const
Definition Array.h:625
ULANG_FORCEINLINE void RemoveAt(int32_t Index, CountType Count, bool bAllowShrinking=true)
Definition Array.h:1202
ElementType & Insert_GetRef(const ElementType &Item, int32_t Index)
Definition Array.h:1137
int32_t Insert(ElementType &&Item, int32_t Index)
Definition Array.h:1078
ULANG_FORCEINLINE void CheckInvariants() const
Definition Array.h:364
ULANG_FORCEINLINE void RemoveAtSwap(int32_t Index)
Definition Array.h:1252
int32_t RemoveSingle(const ElementType &Item)
Definition Array.h:1784
int32_t Insert(std::initializer_list< ElementType > InitList, const int32_t InIndex)
Definition Array.h:986
ULANG_FORCEINLINE TArrayG(const TArrayG &Other)
Definition Array.h:140
void Append(const TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &Source)
Definition Array.h:1408
int32_t Insert(TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&Items, const int32_t InIndex)
Definition Array.h:1024
TArrayG(TArrayG &&Other, int32_t ExtraSlack)
Definition Array.h:267
ULANG_FORCEINLINE const ElementType & Last(int32_t IndexFromTheEnd=0) const
Definition Array.h:551
ULANG_FORCEINLINE ElementType * end()
Definition Array.h:1950
bool Contains(const ComparisonType &Item) const
Definition Array.h:811
int32_t _ArrayNum
Definition Array.h:2088
ULANG_FORCEINLINE ElementType & Top()
Definition Array.h:513
ULANG_FORCEINLINE TArrayG(const typename ElementAllocatorType::RawAllocatorType &RawAllocator)
Definition Array.h:72
TArrayG & operator+=(const TArrayG &Other)
Definition Array.h:1503
TArrayG(std::initializer_list< InElementType > InitList, RawAllocatorArgsType &&... RawAllocatorArgs)
Definition Array.h:107
ULANG_FORCEINLINE ElementType Pop(bool bAllowShrinking=true)
Definition Array.h:476
TArrayG & operator+=(std::initializer_list< ElementType > InitList)
Definition Array.h:1514
ULANG_FORCEINLINE ElementType & Emplace_GetRef(ArgsType &&... Args)
Definition Array.h:1541
int32_t AddDefaulted(int32_t Count=1)
Definition Array.h:1683
ULANG_FORCEINLINE int32_t AddUnique(ElementType &&Item)
Definition Array.h:1736
bool operator==(const TArrayG &OtherArray) const
Definition Array.h:842
ElementType & InsertDefaulted_GetRef(int32_t Index)
Definition Array.h:971
ULANG_FORCEINLINE bool FindLast(const ElementType &Item, int32_t &Index) const
Definition Array.h:613
ULANG_FORCEINLINE TArrayG(TArrayG &&Other)
Definition Array.h:255
ULANG_FORCEINLINE const ElementAllocatorType::RawAllocatorType & GetRawAllocator() const
Definition Array.h:419
InElementAllocatorType ElementAllocatorType
Definition Array.h:58
int32_t IndexOfByPredicate(Predicate Pred) const
Definition Array.h:700
void Append(TArrayG< ElementType, OtherElementAllocatorType, OtherRawAllocatorArgsType... > &&Source)
Definition Array.h:1434
int32_t FindLastByPredicate(Predicate Pred, int32_t Count) const
Definition Array.h:646
ULANG_FORCEINLINE void RangeCheck(int32_t Index) const
Definition Array.h:374
ULANG_FORCEINLINE void Reserve(int32_t Number)
Definition Array.h:1753
ElementType * FindByPredicate(Predicate Pred)
Definition Array.h:769
ULANG_FORCEINLINE void RemoveAtSwap(int32_t Index, CountType Count, bool bAllowShrinking=true)
Definition Array.h:1270
ULANG_FORCEINLINE uint32_t GetAllocatedSize(void) const
Definition Array.h:345
int32_t Insert(const ElementType &Item, int32_t Index)
Definition Array.h:1097
ULANG_FORCEINLINE int32_t Add(ElementType &&Item)
Definition Array.h:1587
void InsertUninitialized(int32_t Index, int32_t Count=1)
Definition Array.h:895
int32_t IndexOfByKey(const KeyType &Key) const
Definition Array.h:680
ULANG_FORCEINLINE bool IsValidIndex(int32_t Index) const
Definition Array.h:391
ULANG_FORCEINLINE ElementType & operator[](int32_t Index)
Definition Array.h:451
int32_t RemoveAll(const PREDICATE_CLASS &Predicate)
Definition Array.h:1831
void Sort()
Definition Array.h:1963
ULANG_FORCEINLINE int32_t Num() const
Definition Array.h:402
Definition Conditionals.h:116
Definition Conditionals.h:95
Definition OverriddenPropertySet.cpp:45
ULANG_FORCEINLINE void StableSort(RangeType &&Range)
Definition StableSort.h:125
ULANG_FORCEINLINE void Sort(RangeType &&Range)
Definition Sort.h:18
Definition VVMEngineEnvironment.h:23
ULANG_FORCEINLINE TRemoveReference< T >::Type && MoveIfPossible(T &&Obj)
Definition References.h:104
constexpr uint32_t HashCombineFast(uint32_t A, uint32_t B)
Definition HashTraits.h:40
@ IndexNone
Definition Common.h:381
ULANG_FORCEINLINE TEnableIf< TTypeTraits< ElementType >::IsBytewiseComparable, bool >::Type CompareElements(const ElementType *A, const ElementType *B, int32_t Count)
Definition MemoryOps.h:182
ULANG_FORCEINLINE TEnableIf<!TIsTriviallyDestructible< ElementType >::Value >::Type DestructElements(ElementType *Element, int32_t Count)
Definition MemoryOps.h:91
ULANG_FORCEINLINE T && ForwardArg(typename TRemoveReference< T >::Type &Obj)
Definition References.h:115
ULANG_FORCEINLINE TRemoveReference< T >::Type && Move(T &&Obj)
Definition References.h:86
ULANG_FORCEINLINE uint32_t GetTypeHash(const TArray< T > Array)
Definition Array.h:2132
U16 Index
Definition radfft.cpp:71
@ Value
Definition Array.h:27
typename FromArrayType::ElementType FromElementType
Definition Array.h:22
typename ToArrayType::ElementType ToElementType
Definition Array.h:23
typename ToArrayType::ElementAllocatorType ToAllocatorType
Definition Array.h:21
typename FromArrayType::ElementAllocatorType FromAllocatorType
Definition Array.h:20
Definition Allocator.h:238
Definition TypeTraits.h:36
@ Value
Definition TypeTraits.h:37
Definition TypeTraits.h:451
@ MoveWillEmptyContainer
Definition TypeTraits.h:453
Definition TypeTraits.h:456
Definition TypeTraits.h:473
Definition TypeTraits.h:263
@ Value
Definition TypeTraits.h:264
@ Value
Definition Array.h:2124
Definition TypeTraits.h:325