UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LegacyPushModel.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if WITH_PUSH_MODEL
6
7#include "CoreTypes.h"
10
11namespace UE::Net
12{
13 struct FReplicationProtocol;
14 struct FReplicationInstanceProtocol;
15}
16
17namespace UE::Net::Private
18{
19
23
25{
26public:
28
29 bool IsValid() const;
30
31private:
32 friend struct FNetHandleLegacyPushModelHelper;
33
34 explicit FNetPushObjectHandle(UEPushModelPrivate::FNetIrisPushObjectId PushId);
35 FNetHandle GetNetHandle() const;
36 UEPushModelPrivate::FNetIrisPushObjectId GetPushObjectId() const;
37
38 FNetHandle NetHandle;
39};
40
41struct FNetHandleLegacyPushModelHelper
42{
43 static void InitPushModel();
44 static void ShutdownPushModel();
45
48
49private:
50 static void MarkPropertyOwnerDirty(const UObject* Object, UEPushModelPrivate::FNetIrisPushObjectId PushId, const int32 RepIndex);
51 static void MarkPropertiesOwnerDirty(const UObject* Object, UEPushModelPrivate::FNetIrisPushObjectId PushId, const int32 StartRepIndex, const int32 EndRepIndex);
52
53 static void OptionallyMarkPropertyOwnerDirty(const UObject* Object, UEPushModelPrivate::FNetIrisPushObjectId PushId, const int32 RepIndex);
54 static void OptionallyMarkPropertiesOwnerDirty(const UObject* Object, UEPushModelPrivate::FNetIrisPushObjectId PushId, const int32 StartRepIndex, const int32 EndRepIndex);
55};
56
57
58inline FNetPushObjectHandle::FNetPushObjectHandle(FNetHandle InNetHandle)
59: NetHandle(InNetHandle)
60{
61}
62
63inline FNetPushObjectHandle::FNetPushObjectHandle(UEPushModelPrivate::FNetIrisPushObjectId PushId)
64: NetHandle(static_cast<uint64>(PushId))
65{
66}
67
68inline bool FNetPushObjectHandle::IsValid() const
69{
70 return NetHandle.IsValid();
71}
72
73inline FNetHandle FNetPushObjectHandle::GetNetHandle() const
74{
75 return NetHandle;
76}
77
78inline UEPushModelPrivate::FNetIrisPushObjectId FNetPushObjectHandle::GetPushObjectId() const
79{
80 return NetHandle.GetInternalValue();
81}
82
83}
84
85#define UE_NET_IRIS_SET_PUSH_ID(...) UE::Net::Private::FNetHandleLegacyPushModelHelper::SetNetPushID(__VA_ARGS__)
86#define UE_NET_IRIS_CLEAR_PUSH_ID(...) UE::Net::Private::FNetHandleLegacyPushModelHelper::ClearNetPushID(__VA_ARGS__)
87
88#define UE_NET_IRIS_INIT_LEGACY_PUSH_MODEL() UE::Net::Private::FNetHandleLegacyPushModelHelper::InitPushModel()
89#define UE_NET_IRIS_SHUTDOWN_LEGACY_PUSH_MODEL() UE::Net::Private::FNetHandleLegacyPushModelHelper::ShutdownPushModel()
90
91#else
92
93namespace UE::Net::Private
94{
95
96inline constexpr bool IsIrisPushModelEnabled(bool /* bIsPushModelEnabled */ = false) { return false; }
97
98}
99
100#define UE_NET_IRIS_SET_PUSH_ID(...)
101#define UE_NET_IRIS_CLEAR_PUSH_ID(...)
102
103#define UE_NET_IRIS_INIT_LEGACY_PUSH_MODEL()
104#define UE_NET_IRIS_SHUTDOWN_LEGACY_PUSH_MODEL()
105
106#endif
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define IS_PUSH_MODEL_ENABLED()
Definition PushModel.h:487
Definition Object.h:95
Definition NetworkVersion.cpp:28
constexpr bool IsIrisPushModelEnabled(bool=false)
Definition LegacyPushModel.h:96
Definition NetworkVersion.cpp:28