Core - Adding support for getting the PathName from a ObjectPtr without resolving the Object*.

Core - Refactoring the Object Handle event callbacks so that we can hook and unhook them with delegates/delegatehandles.
Core - Adding support for detecting loads via object handles as a new event distinct from resolution callback.
Core - Expanding the utility functions on FObjectRef so that we can resolve it in a myraid of fashions to get the path, the class path, the full path and the export path.

[REVIEW] [at]Zousar.Shaker, [at]Joe.Pribele

[CL 22063982 by nick darnell in ue5-main branch]
This commit is contained in:
nick darnell
2022-09-16 20:26:12 -04:00
parent c18e1815c7
commit 42c12e3776
9 changed files with 444 additions and 89 deletions

View File

@@ -86,19 +86,10 @@ private:
{
NumFailedResolves++;
}
if (PrevResolvedFunc)
{
PrevResolvedFunc(ObjectRef, Pkg, Obj);
}
}
static void OnRefRead(UObject* Obj)
{
NumReads++;
if (PrevReadFunc)
{
PrevReadFunc(Obj);
}
}
#endif
@@ -116,16 +107,18 @@ private:
if (!bCallbacksInstalled)
{
#if UE_WITH_OBJECT_HANDLE_TRACKING
PrevResolvedFunc = SetObjectHandleReferenceResolvedCallback(OnRefResolved);
PrevReadFunc = SetObjectHandleReadCallback(OnRefRead);
ResolvedCallbackHandle = AddObjectHandleReferenceResolvedCallback(FObjectHandleReferenceResolvedDelegate::CreateStatic(OnRefResolved));
HandleReadCallbackHandle = AddObjectHandleReadCallback(FObjectHandleReadDelegate::CreateStatic(OnRefRead));
// TODO We should unhook these handles somewhere, but i don't want to refactor the test, it's not as if they were
// being unhooked before. So...
#endif
bCallbacksInstalled = true;
}
}
#if UE_WITH_OBJECT_HANDLE_TRACKING
static ObjectHandleReferenceResolvedFunction* PrevResolvedFunc;
static ObjectHandleReadFunction* PrevReadFunc;
static FDelegateHandle ResolvedCallbackHandle;
static FDelegateHandle HandleReadCallbackHandle;
#endif
static thread_local uint32 NumResolves;
static thread_local uint32 NumFailedResolves;