UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NetJournal.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
8
10
11#ifndef UE_NET_ENABLE_READ_JOURNAL
12#if (UE_BUILD_SHIPPING)
13# define UE_NET_ENABLE_READ_JOURNAL 1
14#else
15# define UE_NET_ENABLE_READ_JOURNAL 1
16#endif
17#endif
18
19#if UE_NET_ENABLE_READ_JOURNAL
21 #define UE_ADD_READ_JOURNAL_ENTRY(SerializationContext, Name) SerializationContext.AddReadJournalEntry(Name);
22 #define UE_RESET_READ_JOURNAL(SerializationContext) SerializationContext.ResetReadJournal();
23#else
24 #define UE_ADD_READ_JOURNAL_ENTRY(...)
25#define UE_RESET_READ_JOURNAL(...)
26#endif
27
28namespace UE::Net
29{
30// Simple journal to track last few entries of read data
32{
33 static constexpr uint32 JournalSize = 32U;
34 static constexpr uint32 JournalMask = JournalSize - 1U;
35
36public:
37 void Reset() { NumEntries = 0U; }
39 void AddEntry(const TCHAR* Name, uint32 BitOffset, FNetRefHandle NetRefHandle);
40 FString Print(const UReplicationSystem* ReplicationSystem) const;
41
42private:
43 struct FJournalEntry
44 {
45 const TCHAR* Name;
46 FNetRefHandle NetRefHandle;
47 uint32 BitOffset;
48 };
49 FJournalEntry Entries[JournalSize];
50 uint32 NumEntries = 0U;
51};
52
53inline void FNetJournal::AddEntry(const TCHAR* Name, uint32 BitOffset, FNetRefHandle NetRefHandle)
54{
55 Entries[NumEntries & JournalMask] = FJournalEntry({Name, NetRefHandle, BitOffset});
56 ++NumEntries;
57}
58
59}
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NetJournal.h:32
FString Print(const UReplicationSystem *ReplicationSystem) const
Definition NetJournal.cpp:11
void AddEntry(const TCHAR *Name, uint32 BitOffset, FNetRefHandle NetRefHandle)
Definition NetJournal.h:53
void Reset()
Definition NetJournal.h:37
Definition NetRefHandle.h:25
Definition ReplicationSystem.h:70
Definition NetworkVersion.cpp:28