UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RemoteObject.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
8
9class UObject;
10class UClass;
11
20namespace UE::RemoteObject
21{
25 UE_DEPRECATED(5.6, "Use FRemoteServerId::GetLocalServerId() instead.")
30}
31
33{
35 {
36 friend struct FRemoteObjectId;
37
39
40 //IMPORTANT: LocalIslandIndex = 0 means it's invalid.
42
43 void Reset();
44
45 FPhysicsIslandId() = default;
46
51
53 {
54 return PhysicsServerId == Other.PhysicsServerId && PhysicsLocalIslandId == Other.PhysicsLocalIslandId;
55 }
56
57 bool IsValid() const
58 {
60 }
61
62 bool operator<(const FPhysicsIslandId& Other) const
63 {
64 return PhysicsServerId < Other.PhysicsServerId ||
65 (PhysicsServerId == Other.PhysicsServerId && PhysicsLocalIslandId < Other.PhysicsLocalIslandId);
66 }
67
69 {
70 return (*this) < Other || (*this) == Other;
71 }
72
74 {
75 Ar << ID.PhysicsServerId;
76 Ar << ID.PhysicsLocalIslandId;
77 return Ar;
78 }
79
80 FString ToString() const
81 {
82 return FString::Printf(TEXT("[%s, %d]"), *(PhysicsServerId.ToString()), PhysicsLocalIslandId);
83 }
84 };
85
87 {
88 // Combine hashes of the members
89 return HashCombine(::GetTypeHash(Key.PhysicsServerId.GetIdNumber()), ::GetTypeHash(Key.PhysicsLocalIslandId));
90 }
91
96 {
98
99 FRemoteObjectClass() = default;
101
102 bool IsNative() const
103 {
104 return !(PathNameOrClass & 1);
105 }
106
107 bool IsValid() const
108 {
109 return !!PathNameOrClass;
110 }
111
113 };
114
115 // Structure that holds basic information about a remote object
116 // This is what FObjectPtr that references a remote object actually points to after the remote object's memory has been claimed by GC
139
141 {
142 Strong = 0,
143 Weak = 1
144 };
145
154
162
170
172
178
186
192
197 COREUOBJECT_API bool IsRemote(const UObject* Object);
198
202 COREUOBJECT_API bool IsOwned(const UObject* Object);
203
212
217
222
226 COREUOBJECT_API FPhysicsIslandId GetPhysicsIslandId(const UObject* Object);
227
228 COREUOBJECT_API void ChangePhysicsIslandId(const UObject* Object, FPhysicsIslandId NewPhysicsIslandId);
229
231
236
241}
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::UPTRINT UPTRINT
An unsigned integer the same size as a pointer.
Definition Platform.h:1146
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition NameTypes.h:617
Definition UnrealString.h.inl:34
Definition Class.h:3793
Definition Object.h:95
Definition RemoteObject.cpp:483
void UpdateAllPhysicsServerId(const TMap< FPhysicsIslandId, FPhysicsIslandId > &PhysicsServerMergingMap)
Definition RemoteObject.cpp:675
void ChangeOwnerServerId(const UObject *Object, FRemoteServerId NewOwnerServerId)
Definition RemoteObject.cpp:619
void ChangePhysicsIslandId(const UObject *Object, FPhysicsIslandId NewPhysicsIslandId)
Definition RemoteObject.cpp:651
UE_FORCEINLINE_HINT uint32 GetTypeHash(const FPhysicsIslandId &Key)
Definition RemoteObject.h:86
bool IsRemote(FRemoteObjectId ObjectId)
Definition RemoteObject.cpp:535
FRemoteServerId GetOwnerServerId(const UObject *Object)
Definition RemoteObject.cpp:598
void UpdateAllPhysicsLocalIslandId(const TMap< uint32, uint32 > &PhysicsLocalIslandMergingMap)
Definition RemoteObject.cpp:688
void ClearAllPhysicsServerId()
Definition RemoteObject.cpp:665
UObject * ResolveObject(const FRemoteObjectStub *Stub, ERemoteReferenceType RefType)
Definition RemoteObject.cpp:698
UClass * GetClass(FRemoteObjectId ObjectId, ERemoteObjectGetClassBehavior GetClassBehavior)
Definition RemoteObject.cpp:791
FPhysicsIslandId GetPhysicsIslandId(const UObject *Object)
Definition RemoteObject.cpp:635
bool IsOwned(const UObject *Object)
Definition RemoteObject.cpp:570
ERemoteObjectGetClassBehavior
Definition RemoteObject.h:147
ERemoteReferenceType
Definition RemoteObject.h:141
void TouchResidentObject(UObject *Object)
Definition RemoteObject.cpp:763
bool CanResolveObject(FRemoteObjectId ObjectId)
Definition RemoteObject.cpp:768
Definition RemoteObject.cpp:78
UE_FORCEINLINE_HINT FRemoteServerId GetGlobalServerId()
Definition RemoteObject.h:26
Definition RemoteObjectTypes.h:212
Definition RemoteObjectTypes.h:49
COREUOBJECT_API FString ToString() const
Definition RemoteObject.cpp:1167
static UE_FORCEINLINE_HINT FRemoteServerId GetLocalServerId()
Definition RemoteObjectTypes.h:123
bool IsValid() const
Definition RemoteObjectTypes.h:83
Definition RemoteObject.h:35
FString ToString() const
Definition RemoteObject.h:80
uint32 PhysicsLocalIslandId
Definition RemoteObject.h:41
FPhysicsIslandId(const FRemoteServerId &PhysicsServerIdIn, const uint32 PhysicsLocalIslandIdIn)
Definition RemoteObject.h:47
friend FArchive & operator<<(FArchive &Ar, FPhysicsIslandId &ID)
Definition RemoteObject.h:73
bool operator==(const FPhysicsIslandId &Other) const
Definition RemoteObject.h:52
bool operator<=(const FPhysicsIslandId &Other) const
Definition RemoteObject.h:68
bool operator<(const FPhysicsIslandId &Other) const
Definition RemoteObject.h:62
bool IsValid() const
Definition RemoteObject.h:57
void Reset()
Definition RemoteObject.cpp:1220
FRemoteServerId PhysicsServerId
Definition RemoteObject.h:38
COREUOBJECT_API UClass * GetClass() const
Definition RemoteObject.cpp:505
bool IsValid() const
Definition RemoteObject.h:107
bool IsNative() const
Definition RemoteObject.h:102
UPTRINT PathNameOrClass
Definition RemoteObject.h:97
Definition RemoteObject.h:118
FRemoteServerId ResidentServerId
Definition RemoteObject.h:128
FRemoteServerId OwningServerId
Definition RemoteObject.h:132
FRemoteObjectClass Class
Definition RemoteObject.h:122
FPhysicsIslandId PhysicsIslandId
Definition RemoteObject.h:134
FName Name
Definition RemoteObject.h:121
FRemoteObjectId Id
Definition RemoteObject.h:119
FRemoteObjectId OuterId
Definition RemoteObject.h:120
int32 SerialNumber
Definition RemoteObject.h:125