UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMWriteBarrierInline.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#if WITH_VERSE_VM || defined(__INTELLISENSE__)
5
8
9namespace Verse
10{
11template <typename T>
12inline void TWriteBarrier<T>::ResetTransactionally(FAllocationContext Context)
13{
14 FTransaction* Transaction = Context.CurrentTransaction();
15 checkSlow(Transaction);
16 Transaction->LogBeforeWrite(Context, *this);
17 Reset();
18}
19
20template <typename T>
21inline void TWriteBarrier<T>::SetTransactionally(FAllocationContext Context, TValue NewValue)
22{
23 FTransaction* Transaction = Context.CurrentTransaction();
24 checkSlow(Transaction);
25 Transaction->LogBeforeWrite(Context, *this);
26 Set(Context, NewValue);
27}
28
29template <typename T>
30template <typename TResult>
31auto TWriteBarrier<T>::SetTransactionally(FAllocationContext Context, T& NewValue) -> std::enable_if_t<!bIsVValue, TResult>
32{
33 SetTransactionally(Context, &NewValue);
34}
35
36template <typename T>
37template <typename TResult>
38auto TWriteBarrier<T>::SetNonCellNorPlaceholderTransactionally(FAllocationContext Context, VValue NewValue) -> std::enable_if_t<bIsVValue, TResult>
39{
40 FTransaction* Transaction = Context.CurrentTransaction();
41 checkSlow(Transaction);
42 Transaction->LogBeforeWrite(Context, *this);
44}
45
46template <typename T>
47inline void TWriteBarrier<T>::SetTrailed(FAllocationContext Context, TValue NewValue)
48{
49 if (FTrail* Trail = Context.CurrentTrail())
50 {
51 Trail->LogBeforeWrite(Context, *this);
52 }
53 Set(Context, NewValue);
54}
55
56template <typename T>
57template <typename TResult>
58auto TWriteBarrier<T>::SetNonCellNorPlaceholderTrailed(FAllocationContext Context, VValue NewValue) -> std::enable_if_t<bIsVValue, TResult>
59{
60 if (FTrail* Trail = Context.CurrentTrail())
61 {
62 Trail->LogBeforeWrite(Context, *this);
63 }
65}
66} // namespace Verse
67
68#endif
#define checkSlow(expr)
Definition AssertionMacros.h:332
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Archive.h:36