Navigation
API > API/Runtime > API/Runtime/Core
Description
Creates an FInheritedContextExtension with custom scope callbacks and co-allocated mutable state. The state of type T is constructed in-place inside a derived FInterface and owned by the handle's TSharedPtr, so it lives exactly as long as the last copy of the extension handle. ApplyFn() is called when a task starts executing and returns saved state (preserved per-scope). RestoreFn(SavedState, SharedState) is called when the task scope ends. Access the state after construction via Ext.GetState
Usage (timing accumulation): double OnStartTiming() { return FPlatformTime::Seconds(); } void OnStopTiming(const double& Start, std::atomic
| Name | UE::MakeStatefulInheritedContextExtension |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Async/InheritedContext.h |
| Include Path | #include "Async/InheritedContext.h" |
namespace UE
{
template<auto ApplyFn, auto RestoreFn, typename T, typename... ArgsType>
FInheritedContextExtension UE::MakeStatefulInheritedContextExtension
(
ArgsType &&... Args
)
}