UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UObjectMigrationContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
8
9#define UE_API COREUOBJECT_API
10
13{
15 Receive,
16
18 Send
19};
20
25{
26 Invalid,
27
30
33
36};
38
43{
44 Invalid,
45
47 Loan,
48
51
54
57};
59
62{
65
68
71
74
77
80
83
85 UE_API bool IsValid() const;
86
92
98
101 {
102 checkf(IsInGameThread(), TEXT("%hs: We expect migrations to only occur on the GameThread."), __func__);
103 return CurrentMigrationContext;
104 }
105
106
107private: // Interface used for FScopedObjectMigrationContext
109
110 inline static const FUObjectMigrationContext* CurrentMigrationContext = nullptr;
111 static void SetCurrentMigrationContext(const FUObjectMigrationContext* NewMigrationContext)
112 {
113 checkf(IsInGameThread(), TEXT("%hs: We expect migrations to only occur on the GameThread."), __func__);
114 CurrentMigrationContext = NewMigrationContext;
115 }
116};
117
125{
127 : PreviousMigrationContext(FUObjectMigrationContext::CurrentMigrationContext)
128 {
129 FUObjectMigrationContext::SetCurrentMigrationContext(&NewMigrationContext);
130 }
131
133 {
134 FUObjectMigrationContext::SetCurrentMigrationContext(PreviousMigrationContext);
135 }
136
137private:
138 const FUObjectMigrationContext* PreviousMigrationContext;
139};
140
141#undef UE_API
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
CORE_API bool IsInGameThread()
Definition ThreadingBase.cpp:185
EObjectMigrationSide
Definition UObjectMigrationContext.h:13
#define UE_API
Definition UObjectMigrationContext.h:9
EObjectMigrationRecvType
Definition UObjectMigrationContext.h:25
EObjectMigrationSendType
Definition UObjectMigrationContext.h:43
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition UObjectBase.h:59
FString ToString(uint16 Value)
Definition PathFollowingComponent.cpp:82
Definition RemoteObjectTypes.h:212
Definition RemoteObjectTypes.h:49
Definition RemoteExecutor.h:14
Definition UObjectMigrationContext.h:125
~FScopedObjectMigrationContext()
Definition UObjectMigrationContext.h:132
FScopedObjectMigrationContext(const FUObjectMigrationContext &NewMigrationContext)
Definition UObjectMigrationContext.h:126
Definition UObjectMigrationContext.h:62
EObjectMigrationSide MigrationSide
Definition UObjectMigrationContext.h:79
FRemoteTransactionId MultiServerCommitRequestId
Definition UObjectMigrationContext.h:82
uint32 PhysicsLocalIslandId
Definition UObjectMigrationContext.h:76
UE_API EObjectMigrationSendType GetObjectMigrationSendType(const UObjectBase *Object) const
Definition UObjectMigrationContext.cpp:52
FRemoteObjectId ObjectId
Definition UObjectMigrationContext.h:64
FRemoteServerId PhysicsServerId
Definition UObjectMigrationContext.h:73
static const FUObjectMigrationContext *const GetCurrentMigrationContext()
Definition UObjectMigrationContext.h:100
FRemoteServerId RemoteServerId
Definition UObjectMigrationContext.h:67
FRemoteServerId OwnerServerId
Definition UObjectMigrationContext.h:70
UE_API bool IsValid() const
Definition UObjectMigrationContext.cpp:9
UE_API EObjectMigrationRecvType GetObjectMigrationRecvType(const UObjectBase *Object) const
Definition UObjectMigrationContext.cpp:14