5#include "Containers/Array.h"
8#include "Containers/Set.h"
78 ChunkMask = (1U << ChunkBits) - 1;
88 check(ChunkBits == 0);
89 check(ChunkMask == 0);
105 int32 Chunk = GetChunkForKey(KeyIndex);
117 template <
typename ElementIDType>
123 int32 Chunk = GetChunkForKey(KeyIndex);
164 bEverythingStale =
true;
194 int32 GetChunkForKey(
int32 ElementIndex)
const
197 return ElementIndex >> ChunkBits;
201 int32 GetChunkElementForKey(
int32 ElementIndex)
const
204 return ElementIndex & ChunkMask;
208 int32 GetChunkSize()
const {
return (1 << ChunkBits); }
211 int32 GetNumChunksForKeys(
int32 NumElements)
const {
return (NumElements + ChunkMask) >> ChunkBits; }
229 StartIndex.SetNumUninitialized(ChunkSize);
230 Count.SetNumUninitialized(ChunkSize);
231 MaxCount.SetNumUninitialized(ChunkSize);
234 for (
int I = 0; I < ChunkSize; I++)
240 for (
int I = 0; I < ChunkSize; I++)
242 MaxCount[I] = InitialSize;
275 static_assert(
sizeof(
ElementIDType) ==
sizeof(
int32),
"ElementIDType must be 32 bits long");
292 struct FIndexPerChannel
313 int32 InitialSize = 1;
317 uint32 ChunkMask = (1U << ChunkBits) - 1;
320 bool bSuspended =
false;
323 bool bEverythingStale =
true;
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition MeshElementContainer.h:367
Definition MeshElementIndexer.h:48
void SetUnchunked()
Definition MeshElementIndexer.h:85
MESHDESCRIPTION_API void Build()
Definition MeshElementIndexer.cpp:195
TArrayView< const ElementIDType > Find(int32 KeyIndex, int32 KeyChannelIndex=0)
Definition MeshElementIndexer.h:118
MESHDESCRIPTION_API void AddReferenceToKey(int32 KeyIndex, int32 ReferenceIndex, int32 KeyChannelIndex=0)
Definition MeshElementIndexer.cpp:119
TArrayView< const int32 > Find(int32 KeyIndex, int32 KeyChannelIndex=0)
Definition MeshElementIndexer.h:101
FMeshElementIndexer & operator=(FMeshElementIndexer &&)=default
FMeshElementIndexer()=default
MESHDESCRIPTION_API void Reset()
Definition MeshElementIndexer.cpp:34
MESHDESCRIPTION_API void ForceRebuild()
Definition MeshElementIndexer.cpp:50
MESHDESCRIPTION_API void RemoveKey(int32 KeyIndex, int32 KeyChannelIndex=0)
Definition MeshElementIndexer.cpp:58
void Resume()
Definition MeshElementIndexer.h:161
void SetInitialNumReferences(int InInitialSize)
Definition MeshElementIndexer.h:69
MESHDESCRIPTION_API void RemoveReferenceFromKey(int32 KeyIndex, int32 ReferenceIndex, int32 KeyChannelIndex=0)
Definition MeshElementIndexer.cpp:85
FMeshElementIndexer(FMeshElementIndexer &&)=default
void SetChunkSize(int InChunkSize)
Definition MeshElementIndexer.h:75
void Suspend()
Definition MeshElementIndexer.h:156
FMeshElementIndexer(const FMeshElementIndexer &)=delete
FMeshElementIndexer & operator=(const FMeshElementIndexer &)=delete
Definition NameTypes.h:617
Definition ArrayView.h:139
UE_REWRITE SizeType Num() const
Definition Array.h:1144
Definition MeshAttributeArray.h:836
UE_REWRITE void Sort(RangeType &&Range)
Definition Sort.h:16
@ Count
Definition AudioMixerDevice.h:90
GeometryCollection::Facades::FMuscleActivationData Data
Definition MuscleActivationConstraints.h:15
@ Contains
Definition AutomationTest.h:160
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
U16 Index
Definition radfft.cpp:71
Definition MeshTypes.h:22
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131