UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PagedArray.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "CoreTypes.h"
8#include "IteratorAdapter.h"
12#include "Templates/UnrealTemplate.h" // For GetData, GetNum
14
15#include <cstring>
16#include <initializer_list>
17#include <type_traits>
18
19template <typename InElementType, int32 InPageSizeInBytes = 16384, typename InAllocatorType = FDefaultAllocator>
20class TPagedArray;
21
23{
24
28template <typename InElementType, int32 InPageSizeInBytes>
30{
31 static_assert(InPageSizeInBytes >= sizeof(InElementType), "Page size must be greater or equal than element type's");
32
34
35 static constexpr int32 Size = InPageSizeInBytes;
36 static constexpr int32 Capacity = Size / sizeof(ElementType);
37};
38
42template <typename InElementType, typename InPageType, typename InPageTraits>
44{
45public:
49 using SizeType = typename PageType::SizeType;
50
51 TIteratorBase() = default;
52
53protected:
58 : Data(Data), PageIndex(Offset / PageTraits::Capacity), PageOffset(Offset % PageTraits::Capacity)
59 {
60 }
61
63 {
64 return Data[PageIndex][PageOffset];
65 }
66
67 inline void Increment()
68 {
69 if (++PageOffset == PageTraits::Capacity)
70 {
71 PageOffset = 0;
72 ++PageIndex;
73 }
74 }
75
77 {
78 return Data == Other.Data && PageIndex == Other.PageIndex && PageOffset == Other.PageOffset;
79 }
80
81private:
82 PageType* Data = nullptr;
83 SizeType PageIndex = 0;
84 SizeType PageOffset = 0;
85};
86
87template <typename InElementType, typename InPageType, typename InPageTraits>
89
91template <typename ElementType, int32 PageSizeInBytes, typename AllocatorType>
93{
94 using SizeType = typename AllocatorType::SizeType;
95
97
98 SizeType NumElements = InOutPagedArray.Num();
99 Ar << NumElements;
100
101 if (Ar.IsLoading())
102 {
103 InOutPagedArray.Empty(NumElements);
104
105 for (SizeType ElementIndex = 0; ElementIndex < NumElements; ++ElementIndex)
106 {
107 Ar << InOutPagedArray.Emplace_GetRef();
108 }
109 }
110 else
111 {
112 for (ElementType& Element : InOutPagedArray)
113 {
114 Ar << Element;
115 }
116 }
117 return Ar;
118}
119
121template <typename ElementType, int32 PageSizeInBytes, typename AllocatorType>
123{
124 int32 NumElements = InOutPagedArray.Num();
125 FStructuredArchive::FArray Array = Slot.EnterArray(NumElements);
126 if (Slot.GetUnderlyingArchive().IsLoading())
127 {
128 InOutPagedArray.Empty(NumElements);
129
130 for (int32 ElementIndex = 0; ElementIndex < NumElements; ++ElementIndex)
131 {
133 ElementSlot << InOutPagedArray.Emplace_GetRef();
134 }
135 }
136 else
137 {
138 for (ElementType& Element : InOutPagedArray)
139 {
141 ElementSlot << Element;
142 }
143 }
144}
145
146} // namespace UE::Core::PagedArray::Private
147
158template <typename InElementType, int32 InPageSizeInBytes, typename InAllocatorType>
160{
161 template <typename AnyElementType, int32 AnyPageSizeInBytes, typename AnyAllocatorType>
162 friend class TPagedArray;
163
166
167public:
169 using SizeType = typename InAllocatorType::SizeType;
171 using ElementAllocatorType = std::conditional_t<
172 AllocatorType::NeedsElementType,
173 typename AllocatorType::template ForElementType<ElementType>,
174 typename AllocatorType::ForAnyElementType>;
175
176private:
177 [[nodiscard]] static constexpr SizeType GetPageIndex(SizeType Index)
178 {
180 }
181
182 [[nodiscard]] static constexpr SizeType GetPageOffset(SizeType Index)
183 {
185 }
186
187 [[nodiscard]] static constexpr SizeType NumRequiredPages(SizeType Count)
188 {
190 return Count % PageTraits::Capacity == 0 ? Div : Div + 1;
191 }
192
193public:
196
197 [[nodiscard]] static constexpr SizeType MaxPerPage()
198 {
200 }
201
202 [[nodiscard]] TPagedArray() = default;
203
204 [[nodiscard]] TPagedArray(TPagedArray&& Other) : Pages(MoveTemp(Other.Pages)), Count(Other.Count)
205 {
206 Other.Count = 0;
207 }
208
209 [[nodiscard]] TPagedArray(const TPagedArray& Other) = default;
210
211 [[nodiscard]] TPagedArray(std::initializer_list<ElementType> InList)
212 {
213 CopyToEmpty(InList.begin(), static_cast<SizeType>(InList.size()));
214 }
215
217 {
218 check(InSource || !InSize);
219 CopyToEmpty(InSource, InSize);
220 }
221
223 {
224 UE_STATIC_ASSERT_WARN(TIsTriviallyRelocatable_V<InElementType>, "TArray can only be used with trivially relocatable types");
225 }
226
228 {
229 if (this != &Other)
230 {
231 Pages = MoveTemp(Other.Pages);
232 Count = Other.Count;
233 Other.Count = 0;
234 }
235 return *this;
236 }
237
239
240 TPagedArray& operator=(std::initializer_list<ElementType> InList)
241 {
242 Assign(InList);
243 return *this;
244 }
245
247 {
248 CheckValidIndex(Index);
249 return Pages[GetPageIndex(Index)][GetPageOffset(Index)];
250 }
251
253 {
254 CheckValidIndex(Index);
255 return Pages[GetPageIndex(Index)][GetPageOffset(Index)];
256 }
257
265 {
266 SIZE_T Size = 0;
267 Size += Pages.GetAllocatedSize();
268 for (const PageType& Page : Pages)
269 {
270 Size += Page.GetAllocatedSize();
271 }
272 return Size;
273 }
274
280 void CountBytes(FArchive& Ar) const
281 {
282 Ar.CountBytes(Num() * sizeof(ElementType), Max() * sizeof(ElementType));
283 }
284
286 {
287 return Pages.Num() * PageTraits::Capacity;
288 }
289
291 {
292 return Count;
293 }
294
296 {
297 return Pages.Num();
298 }
299
301 {
302 return Index >= 0 && Index < Count;
303 }
304
306 {
307 return !Count;
308 }
309
310 [[nodiscard]] inline const ElementType& Last() const
311 {
312 CheckValidIndex(0);
313 const SizeType LastIndex = Num() - 1;
314 return Pages[GetPageIndex(LastIndex)][GetPageOffset(LastIndex)];
315 }
316
318 {
319 CheckValidIndex(0);
320 const SizeType LastIndex = Num() - 1;
321 return Pages[GetPageIndex(LastIndex)][GetPageOffset(LastIndex)];
322 }
323
328 void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking = UE::Core::Private::AllowShrinkingByDefault<AllocatorType>())
329 {
330 const SizeType RequiredPageCount = NumRequiredPages(NewNum);
331 if (NewNum > Num())
332 {
333 Pages.SetNum(RequiredPageCount);
334 SizeType PageIndex = 0;
335 SizeType PendingCount = NewNum;
336 while (PendingCount >= PageTraits::Capacity)
337 {
338 Pages[PageIndex++].SetNum(PageTraits::Capacity);
339 PendingCount -= PageTraits::Capacity;
340 }
341 if (PendingCount)
342 {
343 Pages[PageIndex].Reserve(PageTraits::Capacity);
344 Pages[PageIndex].SetNum(PendingCount, EAllowShrinking::No);
345 }
346 }
347 else if (NewNum < Num())
348 {
349 SizeType PendingCount = Num() - NewNum;
350 Pages.SetNum(RequiredPageCount, AllowShrinking);
352 {
353 Pages.Last().SetNum(Mod, EAllowShrinking::No);
354 }
355 }
356 Count = NewNum;
357 }
359 UE_FORCEINLINE_HINT void SetNum(SizeType NewNum, bool bAllowShrinking)
360 {
362 }
363
364 /*
365 * Fills the memory used by the container elements with the parameter byte value.
366 */
368 {
369 for (PageType& Page : Pages)
370 {
371 if (Page.IsEmpty())
372 {
373 break;
374 }
375 std::memset((void*)Page.GetData(), ByteValue, Page.Num() * sizeof(ElementType));
376 }
377 }
378
379 /*
380 * Sets the memory used by the container elements to zero.
381 */
383 {
384 SetMem(0);
385 }
386
387 /*
388 * Appends the parameter contiguous range to this container.
389 */
391 {
392 check(InSource || !InSize);
393 GrowIfRequired(Count + InSize);
394 CopyUnchecked(InSource, InSize);
395 }
396
397 void Append(std::initializer_list<ElementType> InList)
398 {
399 Append(InList.begin(), static_cast<SizeType>(InList.size()));
400 }
401
402 template <
403 typename ContainerType
405 >
407 {
409 }
410
411 /*
412 * Appends a compatible paged array to this container.
413 * Note TPagedArray doesn't meet TIsContiguousContainer traits so it won't use the contiguous container overload.
414 */
415 template <int32 OtherPageSizeInBytes, typename OtherAllocator>
417 {
419 using OtherPageType = typename OtherType::PageType;
420 GrowIfRequired(Count + Other.Count);
421 for (const OtherPageType& Page : Other.Pages)
422 {
423 CopyUnchecked(Page.GetData(), Page.Num());
424 }
425 }
426
432 {
433 Reset();
435 }
436
437 void Assign(std::initializer_list<ElementType> InList)
438 {
439 Reset();
440 Append(InList.begin(), static_cast<SizeType>(InList.size()));
441 }
442
443 template <
444 typename ContainerType
446 >
447 void Assign(ContainerType&& Container)
448 {
449 Reset();
451 }
452
458 template <int32 OtherPageSizeInBytes, typename OtherAllocator>
464
465 /*
466 * Constructs an element in place using the parameter arguments and adds it at the back of the container.
467 * This method returns a reference to the constructed element.
468 */
469 template <typename... ArgsType>
471 {
472 GrowIfRequired();
473 const SizeType ElementIndex = Num();
474 const SizeType PageIndex = GetPageIndex(ElementIndex);
475 Pages[PageIndex].Emplace(Forward<ArgsType>(Args)...);
476 ++Count;
477 return ElementIndex;
478 }
479
480 /*
481 * Constructs an element in place using the parameter arguments and adds it at the back of the container.
482 * This method returns a reference to the constructed element.
483 */
484 template <typename... ArgsType>
486 {
487 GrowIfRequired();
488 const SizeType PageIndex = GetPageIndex(Num());
489 ElementType& Result = Pages[PageIndex].Emplace_GetRef(Forward<ArgsType>(Args)...);
490 ++Count;
491 return Result;
492 }
493
494 /*
495 * Adds the parameter element at the back of the container.
496 */
498 {
499 return Emplace(Element);
500 }
501
503 {
504 return Emplace(MoveTempIfPossible(Element));
505 }
506
508 {
509 return Emplace_GetRef(Element);
510 }
511
516
518 {
519 Emplace(Element);
520 }
521
523 {
524 Emplace(MoveTempIfPossible(Element));
525 }
526
527 /*
528 * Removes the last element in the container.
529 */
530 void Pop(EAllowShrinking AllowShrinking = UE::Core::Private::AllowShrinkingByDefault<AllocatorType>())
531 {
532 CheckValidIndex(0);
533 const SizeType LastIndex = Num() - 1;
534 const SizeType LastPageIndex = GetPageIndex(LastIndex);
535 const SizeType LastIndexInPage = GetPageOffset(LastIndex);
538 {
539 Pages.SetNum(LastPageIndex);
540 }
541 --Count;
542 }
544 UE_FORCEINLINE_HINT void Pop(bool bAllowShrinking)
545 {
546 Pop(bAllowShrinking ? EAllowShrinking::Yes : EAllowShrinking::No);
547 }
548
554 void RemoveAtSwap(SizeType Index, EAllowShrinking AllowShrinking = UE::Core::Private::AllowShrinkingByDefault<AllocatorType>())
555 {
556 CheckValidIndex(Index);
557 const SizeType TargetPageIndex = GetPageIndex(Index);
558 const SizeType TargetIndexInPage = GetPageOffset(Index);
559 const SizeType LastIndex = Num() - 1;
560 const SizeType LastPageIndex = GetPageIndex(LastIndex);
562 {
565 {
566 Pages.SetNum(TargetPageIndex);
567 }
568 }
569 else
570 {
571 const SizeType LastIndexInPage = GetPageOffset(LastIndex);
574 }
575 --Count;
576 }
578 UE_FORCEINLINE_HINT void RemoveAtSwap(SizeType Index, bool bAllowShrinking)
579 {
581 }
582
583 /*
584 * Empties the container effectively destroying all contained elements and releases any acquired storage.
585 */
586 void Empty()
587 {
588 Pages.Empty();
589 Count = 0;
590 }
591
592 /*
593 * Empties the container effectively destroying all contained elements and ensures storage for the parameter
594 * capacity. Storage is adjusted to meet the parameter capacity value.
595 */
597 {
598 Reset();
599
600 const SizeType PageCount = Pages.Num();
601 const SizeType RequiredPageCount = NumRequiredPages(InCapacity);
602 Pages.SetNum(RequiredPageCount);
603 for (SizeType Index = PageCount; Index < RequiredPageCount; ++Index)
604 {
605 Pages[Index].Reserve(PageTraits::Capacity);
606 }
607 }
608
609 /*
610 * Destroys all contained elements but doesn't release the container's storage.
611 */
612 void Reset()
613 {
614 for (PageType& Page : Pages)
615 {
616 Page.Reset();
617 }
618 Count = 0;
619 }
620
621 /*
622 * Destroys all contained elements and ensures storage for the parameter capacity. Storage is only acquired
623 * if the current container's storage cannot meet the parameter capacity value.
624 */
626 {
627 Reset();
629 }
630
631 /*
632 * Reserves storage for the parameter element count.
633 */
635 {
636 check(InCount >= 0);
637 GrowIfRequired(InCount);
638 }
639
640 /*
641 * Copies this container elements into the parameter destination array.
642 */
643 template <typename AnyAllocator>
645 {
646 OutDestination.Reset();
647 OutDestination.Reserve(Count);
648 for (const PageType& Page : Pages)
649 {
650 if (Page.IsEmpty())
651 {
652 break;
653 }
654 OutDestination.Append(Page);
655 }
656 }
657
658 /*
659 * Moves this container elements into the parameter destination array.
660 */
661 template <typename AnyAllocator>
663 {
664 OutDestination.Reset();
665 OutDestination.Reserve(Count);
666 for (PageType& Page : Pages)
667 {
668 if (Page.IsEmpty())
669 {
670 break;
671 }
673 }
674 Count = 0;
675 }
676
679 {
680 return GetIterator(0);
681 }
683 {
684 return GetIterator(0);
685 }
687 {
688 return GetIterator(Count);
689 }
691 {
692 return GetIterator(Count);
693 }
694
695 // Friend operators
696 [[nodiscard]] bool operator==(const TPagedArray& Right) const
697 {
698 if (Num() != Right.Num())
699 {
700 return false;
701 }
702 const SizeType MinPageCount = NumRequiredPages(Count);
703 for (SizeType PageIndex = 0; PageIndex < MinPageCount; ++PageIndex)
704 {
705 if (Pages[PageIndex] != Right.Pages[PageIndex])
706 {
707 return false;
708 }
709 }
710 return true;
711 }
712
714 {
715 return !(*this == Right);
716 }
717
718private:
719 TArray<PageType> Pages;
720 SizeType Count = 0;
721
723 {
724 return ConstIteratorType(InPlace, Pages.GetData(), Offset);
725 }
726
728 {
729 return IteratorType(InPlace, Pages.GetData(), Offset);
730 }
731
732 /*
733 * Adds a new page and reserves its capacity predefined by its traits.
734 */
735 PageType& AddPage()
736 {
737 PageType& Page = Pages.Emplace_GetRef();
738 Page.Reserve(PageTraits::Capacity);
739 return Page;
740 }
741
742 /*
743 * Copies the parameter element array of the parameter size into this container.
744 * This method assumes no previously existing content.
745 */
746 void CopyToEmpty(const ElementType* InSource, SizeType InSize)
747 {
748 checkSlow(!Count);
749 if (InSize)
750 {
751 Grow(InSize);
752 CopyUnchecked(InSource, InSize);
753 }
754 }
755
756 /*
757 * Copies the parameter element array of the parameter size into this container.
758 */
759 void CopyUnchecked(const ElementType* InSource, SizeType InSize)
760 {
761 if (InSize)
762 {
763 SizeType PageIndex = GetPageIndex(Count);
764 SizeType PendingCount = InSize;
765 if (const SizeType PageOffset = GetPageOffset(Count))
766 {
767 const SizeType AppendCount = FMath::Min(PageTraits::Capacity - PageOffset, PendingCount);
768 Pages[PageIndex++].Append(InSource, AppendCount);
770 PendingCount -= AppendCount;
771 }
772 while (PendingCount >= PageTraits::Capacity)
773 {
774 Pages[PageIndex++].Append(InSource, PageTraits::Capacity);
776 PendingCount -= PageTraits::Capacity;
777 }
778 if (PendingCount)
779 {
780 Pages[PageIndex].Append(InSource, PendingCount);
781 }
782 Count += InSize;
783 }
784 }
785
786 /*
787 * Grows the container's storage to the parameter capacity value allocating the required page count.
788 * This method assumes the container's current capacity is smaller than the parameter value.
789 * This method preserves existing data.
790 */
792 {
794 const SizeType RequiredPageCount = NumRequiredPages(InCapacity);
796 for (SizeType Index = Pages.Num(); Index < RequiredPageCount; ++Index)
797 {
798 AddPage();
799 }
800 }
801
802 /*
803 * Grows the container by adding a new page if full.
804 * This method preserves existing data.
805 */
806 void GrowIfRequired()
807 {
808 if (Count == Max())
809 {
810 AddPage();
811 }
812 }
813
814 /*
815 * Grows the container's storage to meet the parameter capacity value.
816 * This method preserves existing data.
817 */
818 void GrowIfRequired(SizeType InCapacity)
819 {
820 if (Max() < InCapacity)
821 {
823 }
824 }
825
826 UE_FORCEINLINE_HINT void CheckValidIndex(SizeType Index) const
827 {
828 checkf((Index >= 0) & (Index < Count), TEXT("Parameter index %d exceeds container size %d"), Index, Count);
829 }
830};
831
833template <typename ElementType, int32 PageSizeInBytes, typename AllocatorType>
838
840template <typename ElementType, int32 PageSizeInBytes, typename AllocatorType>
EAllowShrinking
Definition AllowShrinking.h:10
#define UE_ALLOWSHRINKING_BOOL_DEPRECATED(FunctionName)
Definition AllowShrinking.h:31
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define UE_STATIC_ASSERT_WARN(bExpression, Message)
Definition CoreMiscDefines.h:431
@ InPlace
Definition CoreMiscDefines.h:162
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_FORCEINLINE_HINT FArchive & operator<<(FArchive &Ar, TPagedArray< ElementType, PageSizeInBytes, AllocatorType > &InOutPagedArray)
Definition PagedArray.h:834
#define UE_REQUIRES(...)
Definition Requires.h:86
auto GetNum(const TStringConversion< Converter, DefaultConversionSize > &Conversion) -> decltype(Conversion.Length())
Definition StringConv.h:808
auto GetData(const TStringConversion< Converter, DefaultConversionSize > &Conversion) -> decltype(Conversion.Get())
Definition StringConv.h:802
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTempIfPossible(T &&Obj) noexcept
Definition UnrealTemplate.h:538
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Offset
Definition VulkanMemory.cpp:4033
uint32 Size
Definition VulkanMemory.cpp:4034
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
virtual void CountBytes(SIZE_T InNum, SIZE_T InMax)
Definition Archive.h:125
Definition StructuredArchiveSlots.h:172
Definition StructuredArchiveSlots.h:52
UE_API FStructuredArchiveArray EnterArray(int32 &Num)
Definition StructuredArchiveSlots.h:257
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_FORCEINLINE_HINT ElementType & Emplace_GetRef(ArgsType &&... Args) UE_LIFETIMEBOUND
Definition Array.h:2613
void Append(const TArray< OtherElementType, OtherAllocatorType > &Source)
Definition Array.h:2412
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition IteratorAdapter.h:30
Definition PagedArray.h:160
UE_FORCEINLINE_HINT SizeType Max() const
Definition PagedArray.h:285
UE_FORCEINLINE_HINT bool IsEmpty() const
Definition PagedArray.h:305
void RemoveAtSwap(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition PagedArray.h:554
void Reset(SizeType InCapacity)
Definition PagedArray.h:625
TPagedArray(const TPagedArray &Other)=default
UE::Core::PagedArray::Private::TIterator< const ElementType, const PageType, PageTraits > ConstIteratorType
Definition PagedArray.h:194
std::conditional_t< AllocatorType::NeedsElementType, typename AllocatorType::template ForElementType< ElementType >, typename AllocatorType::ForAnyElementType > ElementAllocatorType
Definition PagedArray.h:174
TPagedArray()=default
UE_FORCEINLINE_HINT void Push(const ElementType &Element)
Definition PagedArray.h:517
void ToArray(TArray< ElementType, AnyAllocator > &OutDestination) &&
Definition PagedArray.h:662
typename InAllocatorType::SizeType SizeType
Definition PagedArray.h:169
void Reserve(SizeType InCount)
Definition PagedArray.h:634
UE_FORCEINLINE_HINT ElementType & Add_GetRef(ElementType &&Element)
Definition PagedArray.h:512
ElementType & operator[](SizeType Index)
Definition PagedArray.h:252
ElementType & Last()
Definition PagedArray.h:317
void Assign(ContainerType &&Container)
Definition PagedArray.h:447
void Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition PagedArray.h:530
UE_FORCEINLINE_HINT SizeType NumPages() const
Definition PagedArray.h:295
~TPagedArray()
Definition PagedArray.h:222
InElementType ElementType
Definition PagedArray.h:170
UE_FORCEINLINE_HINT ConstIteratorType end() const
Definition PagedArray.h:686
void Assign(std::initializer_list< ElementType > InList)
Definition PagedArray.h:437
UE_FORCEINLINE_HINT SizeType Add(const ElementType &Element)
Definition PagedArray.h:497
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition PagedArray.h:328
void Assign(const ElementType *InSource, SizeType InSize)
Definition PagedArray.h:431
static constexpr SizeType MaxPerPage()
Definition PagedArray.h:197
bool operator==(const TPagedArray &Right) const
Definition PagedArray.h:696
UE_FORCEINLINE_HINT ElementType & Add_GetRef(const ElementType &Element)
Definition PagedArray.h:507
void ToArray(TArray< ElementType, AnyAllocator > &OutDestination) const &
Definition PagedArray.h:644
void Empty(SizeType InCapacity)
Definition PagedArray.h:596
TPagedArray & operator=(const TPagedArray &Other)=default
UE_FORCEINLINE_HINT IteratorType begin()
Definition PagedArray.h:682
TPagedArray(const ElementType *InSource, SizeType InSize)
Definition PagedArray.h:216
void Append(const TPagedArray< ElementType, OtherPageSizeInBytes, OtherAllocator > &Other)
Definition PagedArray.h:416
UE_FORCEINLINE_HINT ConstIteratorType begin() const
Definition PagedArray.h:678
UE_FORCEINLINE_HINT void SetZero()
Definition PagedArray.h:382
TPagedArray(TPagedArray &&Other)
Definition PagedArray.h:204
void Empty()
Definition PagedArray.h:586
void Append(std::initializer_list< ElementType > InList)
Definition PagedArray.h:397
TPagedArray & operator=(std::initializer_list< ElementType > InList)
Definition PagedArray.h:240
void Append(const ElementType *InSource, SizeType InSize)
Definition PagedArray.h:390
UE_FORCEINLINE_HINT void Push(ElementType &&Element)
Definition PagedArray.h:522
UE_FORCEINLINE_HINT SizeType Num() const
Definition PagedArray.h:290
const ElementType & operator[](SizeType Index) const
Definition PagedArray.h:246
UE_FORCEINLINE_HINT IteratorType end()
Definition PagedArray.h:690
TPagedArray & operator=(TPagedArray &&Other)
Definition PagedArray.h:227
void SetMem(uint8 ByteValue)
Definition PagedArray.h:367
void CountBytes(FArchive &Ar) const
Definition PagedArray.h:280
UE::Core::PagedArray::Private::TIterator< ElementType, PageType, PageTraits > IteratorType
Definition PagedArray.h:195
TPagedArray(std::initializer_list< ElementType > InList)
Definition PagedArray.h:211
UE_FORCEINLINE_HINT void Append(ContainerType &&Container)
Definition PagedArray.h:406
UE_FORCEINLINE_HINT SizeType Add(ElementType &&Element)
Definition PagedArray.h:502
void Reset()
Definition PagedArray.h:612
SizeType Emplace(ArgsType &&... Args)
Definition PagedArray.h:470
ElementType & Emplace_GetRef(ArgsType &&... Args)
Definition PagedArray.h:485
UE_FORCEINLINE_HINT bool IsValidIndex(SizeType Index) const
Definition PagedArray.h:300
void Assign(const TPagedArray< ElementType, OtherPageSizeInBytes, OtherAllocator > &Other)
Definition PagedArray.h:459
UE_FORCEINLINE_HINT bool operator!=(const TPagedArray &Right) const
Definition PagedArray.h:713
const ElementType & Last() const
Definition PagedArray.h:310
InAllocatorType AllocatorType
Definition PagedArray.h:168
SIZE_T GetAllocatedSize() const
Definition PagedArray.h:264
TIteratorBase(InPageType *Data, SizeType Offset)
Definition PagedArray.h:57
UE_FORCEINLINE_HINT ElementType & Dereference() const
Definition PagedArray.h:62
InElementType ElementType
Definition PagedArray.h:46
typename PageType::SizeType SizeType
Definition PagedArray.h:49
void Increment()
Definition PagedArray.h:67
InPageTraits PageTraits
Definition PagedArray.h:48
InPageType PageType
Definition PagedArray.h:47
UE_FORCEINLINE_HINT bool Equals(const TIteratorBase &Other) const
Definition PagedArray.h:76
CORE_API FArchive & GetUnderlyingArchive() const
Definition StructuredArchiveSlots.cpp:7
@ Count
Definition AudioMixerDevice.h:90
Definition PagedArray.h:23
void SerializeStructured(FStructuredArchive::FSlot Slot, TPagedArray< ElementType, PageSizeInBytes, AllocatorType > &InOutPagedArray)
Definition PagedArray.h:122
FArchive & Serialize(FArchive &Ar, TPagedArray< ElementType, PageSizeInBytes, AllocatorType > &InOutPagedArray)
Definition PagedArray.h:92
FValue Div(const FValue &Lhs, const FValue &Rhs)
Definition ShaderValue.cpp:1519
U16 Index
Definition radfft.cpp:71
Definition IsContiguousContainer.h:16
InElementType ElementType
Definition PagedArray.h:33
static constexpr int32 Size
Definition PagedArray.h:35
static constexpr int32 Capacity
Definition PagedArray.h:36