Navigation
API > API/Runtime > API/Runtime/Core
Combines TGuardValue with FInheritedContextExtension + FInheritedContextExtensionScope. Sets a value for the current scope (like TGuardValue) AND propagates it to async tasks launched within the scope (via the inherited context extension mechanism).
Usage with callable accessor (creates extension internally): static thread_local bool GMyFlag = false; TInheritedGuardValue
Usage with pre-built extension (avoids allocation per guard): static auto GExt = UE::MakeInheritedContextExtension([]() -> bool& { return GMyFlag; }); TInheritedGuardValue
| Name | TInheritedGuardValue |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Async/InheritedGuardValue.h |
| Include Path | #include "Async/InheritedGuardValue.h" |
Syntax
template<typename RefType, typename AssignedType>
struct TInheritedGuardValue : private FNoncopyable
Inheritance Hierarchy
- FNoncopyable → TInheritedGuardValue
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TInheritedGuardValue
(
Func GetVar, |
Callable constructor — creates the extension internally. | Async/InheritedGuardValue.h | |
TInheritedGuardValue
(
const UE::FInheritedContextExtension& InExtension, |
Pre-built extension constructor — reuses an existing FInheritedContextExtension. | Async/InheritedGuardValue.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TInheritedGuardValue() |
Async/InheritedGuardValue.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Extension | UE::FInheritedContextExtension | Async/InheritedGuardValue.h | ||
| OriginalValue | AssignedType | Async/InheritedGuardValue.h | ||
| RefValue | RefType & | Async/InheritedGuardValue.h | ||
| Scope | UE::FInheritedContextExtensionScope | Async/InheritedGuardValue.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const AssignedType & GetOriginalValue() |
Provides read-only access to the original value of the data being tracked by this struct | Async/InheritedGuardValue.h |