UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PendingBatchData.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
9
10#include "Templates/UniquePtr.h"
11
12namespace UE::Net::Private
13{
14
16
17}
18
19namespace UE::Net::Private
20{
21// Queued data chunk
38
39// Struct to contain storage and required data for queued batches pending must be mapped references
41{
42 // We use a single array to store the actual data, it will grow if required.
45
46 // The MustBeMapped references that are still not resolved
48
49 // Resolved references for which we have are holding on to references to avoid GC
51
52 // Owner of the queued data chunks
54
55 // The list of parents that must exist before the owner can be created
57
58 // Time when we started to accumulate data for this object
60
61 // At what time should we warn about being blocked too long
62 double NextWarningTimeout = 0.0;
63
64 // Incremented every time we try to process queued batches, reset each time we output warning.
66
67 // The async loading priority of the Owner
69};
70
72
74{
75public:
76
77 bool Contains(FNetRefHandle NetRefHandle) const
78 {
79 return PendingBatches.Contains(NetRefHandle);
80 }
81
83 {
84 FPendingBatchDataPtr* Ptr = PendingBatches.Find(NetRefHandle);
85 return Ptr ? Ptr->Get() : nullptr;
86 }
87
88 const FPendingBatchData* Find(FNetRefHandle NetRefHandle) const
89 {
90 const FPendingBatchDataPtr* Ptr = PendingBatches.Find(NetRefHandle);
91 return Ptr ? Ptr->Get() : nullptr;
92 }
93
95 {
96 FPendingBatchDataPtr* Ptr = PendingBatches.Find(NetRefHandle);
97 return Ptr ? Ptr->Get() : CreatePendingBatch(NetRefHandle);
98 }
99
100 void Remove(FNetRefHandle NetRefHandle)
101 {
102 PendingBatches.Remove(NetRefHandle);
103 }
104
105 bool IsEmpty() const
106 {
107 return PendingBatches.IsEmpty();
108 }
109
110 int32 Num() const
111 {
112 return PendingBatches.Num();
113 }
114
116 {
117 return PendingBatches.CreateConstIterator();
118 }
119
120 void Empty()
121 {
122 PendingBatches.Empty();
123 }
124
125private:
126
127 FPendingBatchData* CreatePendingBatch(FNetRefHandle Owner);
128
130};
131
132} // namespace UE::Net::Private
133
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
EIrisAsyncLoadingPriority
Definition ObjectReferenceTypes.h:14
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
UE_FORCEINLINE_HINT T * Get() const
Definition UniquePtr.h:324
Definition NetRefHandle.h:25
Definition NetworkVersion.cpp:28
EReplicationDataStreamDebugFeatures
Definition ReplicationDataStreamDebug.h:24
TUniquePtr< FPendingBatchData > FPendingBatchDataPtr
Definition PendingBatchData.h:71
Definition PendingBatchData.h:41
int32 PendingBatchTryProcessCount
Definition PendingBatchData.h:65
uint64 PendingBatchStartCycles
Definition PendingBatchData.h:59
TArray< FQueuedDataChunk, TInlineAllocator< 4 > > QueuedDataChunks
Definition PendingBatchData.h:44
TArray< uint32, TInlineAllocator< 32 > > DataChunkStorage
Definition PendingBatchData.h:43
TArray< FNetRefHandle, TInlineAllocator< 4 > > CreationDependentParents
Definition PendingBatchData.h:56
TArray< FNetRefHandle, TInlineAllocator< 4 > > ResolvedReferences
Definition PendingBatchData.h:50
FNetRefHandle Owner
Definition PendingBatchData.h:53
TArray< FNetRefHandle, TInlineAllocator< 4 > > PendingMustBeMappedReferences
Definition PendingBatchData.h:47
EIrisAsyncLoadingPriority IrisAsyncLoadingPriority
Definition PendingBatchData.h:68
double NextWarningTimeout
Definition PendingBatchData.h:62
Definition PendingBatchData.h:74
auto CreateConstIterator() const
Definition PendingBatchData.h:115
void Empty()
Definition PendingBatchData.h:120
bool IsEmpty() const
Definition PendingBatchData.h:105
const FPendingBatchData * Find(FNetRefHandle NetRefHandle) const
Definition PendingBatchData.h:88
FPendingBatchData * FindOrCreate(FNetRefHandle NetRefHandle)
Definition PendingBatchData.h:94
void Remove(FNetRefHandle NetRefHandle)
Definition PendingBatchData.h:100
bool Contains(FNetRefHandle NetRefHandle) const
Definition PendingBatchData.h:77
int32 Num() const
Definition PendingBatchData.h:110
FPendingBatchData * Find(FNetRefHandle NetRefHandle)
Definition PendingBatchData.h:82
Definition PendingBatchData.h:23
EReplicationDataStreamDebugFeatures StreamDebugFeatures
Definition PendingBatchData.h:36
FQueuedDataChunk()
Definition PendingBatchData.h:24
uint32 NumBits
Definition PendingBatchData.h:33
uint32 bHasBatchOwnerData
Definition PendingBatchData.h:34
uint32 bIsEndReplicationChunk
Definition PendingBatchData.h:35
uint32 StorageOffset
Definition PendingBatchData.h:32