UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DataflowContextCache.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "HAL/Platform.h"
8#include "Templates/Decay.h"
10#include "UObject/GCObject.h"
11#include "UObject/UnrealType.h"
13
14namespace UE::Dataflow
15{
16 class FContext;
17 struct FContextCacheElementBase;
18 struct FContextCacheElementNull;
19
20 template<class T>
21 struct TContextCacheElementUObjectArray;
22
24
26 template <typename T>
28 {
29 typedef typename TDecay<T>::Type Type;
30 static constexpr bool Value = (std::is_pointer_v<Type> && std::is_convertible_v<Type, const UObjectBase*>) || TIsTObjectPtr_V<Type>;
31 };
32
34 template <typename T, typename = void>
35 struct TIsReflectedStruct { static constexpr bool Value = false; };
36 template <typename T>
37 struct TIsReflectedStruct<T, std::void_t<decltype(&TBaseStructure<typename TDecay<T>::Type>::Get)>> { static constexpr bool Value = true; };
38
40 {
41 typedef uint64 Type;
43
45 bool operator>=(const FTimestamp& InTimestamp) const { return Value >= InTimestamp.Value; }
46 bool operator<(const FTimestamp& InTimestamp) const { return Value < InTimestamp.Value; }
47 bool operator==(const FTimestamp& InTimestamp) const { return Value == InTimestamp.Value; }
48 bool IsInvalid() { return Value == Invalid; }
49 bool IsInvalid() const { return Value == Invalid; }
50
53 };
54
60
61 //--------------------------------------------------------------------
62 // base class for all context cache entries
63 //--------------------------------------------------------------------
65 {
76
85
86 // InReferenceDataKey is the key of the cache element this function is called on
88
89 // clone the cache entry
91
92 template<typename T>
93 inline const T& GetTypedData(const IContextCacheStore& Context, const FProperty* PropertyIn, const T& Default) const;
94
95 virtual const void* GetUntypedData(const IContextCacheStore& Context, const FProperty* PropertyIn) const = 0;
96
97 virtual bool IsArray(const IContextCacheStore& Context) const = 0;
101
102 EType GetType() const { return Type; }
103
104 const FProperty* GetProperty() const { return Property; }
105 const FTimestamp& GetTimestamp() const { return Timestamp; }
106 void SetTimestamp(const FTimestamp& InTimestamp) { Timestamp = InTimestamp; }
107
108 const FGuid& GetNodeGuid() const { return NodeGuid; }
109 const uint32 GetNodeHash() const { return NodeHash; }
110
111 // use this with caution: setting the property of a wrong type may cause problems
112 void SetProperty(const FProperty* NewProperty) { Property = NewProperty; }
113
114 // use this with caution: setting the property of a wrong type may cause problems
116 {
117 Property = InProperty;
118 NodeGuid = InNodeGuid;
119 NodeHash = InNodeHash;
120 Timestamp = InTimestamp;
121 }
122
123 private:
124 friend struct FContextCache;
125
126 EType Type;
127 FGuid NodeGuid;
128 const FProperty* Property = nullptr;
129 uint32 NodeHash = 0;
131 };
132
133 //--------------------------------------------------------------------
134 // Value storing context cache entry - strongly typed
135 //--------------------------------------------------------------------
136 template<class T>
138 {
143
148
149 inline const T& GetData(const IContextCacheStore& Context, const FProperty* PropertyIn, const T& Default) const;
150
151 virtual const void* GetUntypedData(const IContextCacheStore& Context, const FProperty* PropertyIn) const
152 {
153 return &Data;
154 }
155
156 virtual bool IsArray(const IContextCacheStore& Context) const override
157 {
159 }
160
162 {
163 if constexpr (TIsTArray<FDataType>::Value)
164 {
165 return Data.Num();
166 }
167 else
168 {
169 return 0;
170 }
171 }
172
174 {
175 if constexpr (TIsTArray<FDataType>::Value)
176 {
177 if (Data.IsValidIndex(Index))
178 {
180 }
181 return {};
182 }
183 else
184 {
185 return {};
186 }
187 }
188
190 {
191 if constexpr (TIsTArray<FDataType>::Value)
192 {
193 return {}; // already an Array
194 }
195 else
196 {
197 TArray<FDataType> Array{ Data };
199 }
200 }
201
202 const T& GetDataDirect() const { return Data; }
203
204 inline virtual TUniquePtr<FContextCacheElementBase> Clone(const IContextCacheStore& Context) const override;
205
206 private:
207 typedef typename TDecay<T>::Type FDataType; // Using universal references here means T could be either const& or an rvalue reference
208 const FDataType Data; // Decaying T removes any reference and gets the correct underlying storage data type
209 };
210
211 //--------------------------------------------------------------------
212 // Reference to another context cache entry
213 //--------------------------------------------------------------------
215 {
220
221
222 template<class T>
223 inline const T& GetData(const IContextCacheStore& Context, const FProperty* PropertyIn, const T& Default) const;
224
225 virtual const void* GetUntypedData(const IContextCacheStore& Context, const FProperty* PropertyIn) const override;
226
227 virtual bool IsArray(const IContextCacheStore& Context) const override;
228
229 virtual int32 GetNumArrayElements(const IContextCacheStore& Context) const override;
230
232
234
236
237 private:
238 const FContextCacheKey DataKey; // this is a key to another cache element
239 };
240
241 //--------------------------------------------------------------------
242 // Null entry, this will always return a default value
243 //--------------------------------------------------------------------
245 {
246 //
247 // IMPORTANT:
248 // Timestamp must be set to (Timestamp.Value - 1) to make sure that this type of entry is always invalid
249 //
250 UE_DEPRECATED(5.6, "Use the other constructor that does not pass a DataKey (the key is not needed)")
254
258
259 virtual const void* GetUntypedData(const IContextCacheStore& Context, const FProperty* PropertyIn) const override;
260
261 virtual bool IsArray(const IContextCacheStore& Context) const override;
262 virtual int32 GetNumArrayElements(const IContextCacheStore& Context) const override;
265
267 };
268
269 //--------------------------------------------------------------------
270 // UObject cache element, prevents the object from being garbage collected while in the cache
271 //--------------------------------------------------------------------
272 template<class T>
274 {
279
284
285 const T& GetData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/, const T& /*Default*/) const
286 {
287 return ObjectPtr;
288 }
289
290 virtual const void* GetUntypedData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/) const override
291 {
292 return (void*)ObjectPtr;
293 }
294
295 virtual bool IsArray(const IContextCacheStore& Context) const override
296 {
297 return false;
298 }
299
301 {
302 return 0;
303 }
304
309
315
316 inline virtual TUniquePtr<FContextCacheElementBase> Clone(const IContextCacheStore& Context) const override;
317
318 //~ Begin FGCObject interface
319 virtual void AddReferencedObjects(FReferenceCollector& Collector) override { Collector.AddReferencedObject(ObjectPtr); }
320 virtual FString GetReferencerName() const override { return TEXT("TContextCacheElementUObject"); }
321 //~ End FGCObject interface
322
323 private:
324 typedef typename TDecay<T>::Type FDataType; // Using universal references here means T could be either const& or an rvalue reference
325 FDataType ObjectPtr; // Decaying T removes any reference and gets the correct underlying storage data type
326 };
327
328 //--------------------------------------------------------------------
329 // TArray<UObjectPtr> cache element, prevents the object from being garbage collected while in the cache
330 //--------------------------------------------------------------------
331 template<class T>
333 {
334 template<typename ArrayT>
339
340
345
346 virtual bool IsArray(const IContextCacheStore& Context) const override
347 {
348 return true;
349 }
350
351 const TArray<T>& GetData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/, const TArray<T>& /*Default*/) const
352 {
353 return ObjectPtrArray;
354 }
355
356 virtual const void* GetUntypedData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/) const override
357 {
358 return &ObjectPtrArray;
359 }
360
362 {
363 return ObjectPtrArray.Num();
364 }
365
367 {
368 if (ObjectPtrArray.IsValidIndex(Index))
369 {
370 FDataType Element = ObjectPtrArray[Index];
372 }
373 return {};
374 }
375
377 {
378 return {}; // no array of array
379 }
380
381 inline virtual TUniquePtr<FContextCacheElementBase> Clone(const IContextCacheStore& Context) const override;
382
383 //~ Begin FGCObject interface
384 virtual void AddReferencedObjects(FReferenceCollector& Collector) override { Collector.AddReferencedObjects(ObjectPtrArray); }
385 virtual FString GetReferencerName() const override { return TEXT("TContextCacheElementUObjectArray"); }
386 //~ End FGCObject interface
387
388 private:
389 typedef typename TDecay<T>::Type FDataType; // Using universal references here means T could be either const& or an rvalue reference
390 TArray<FDataType> ObjectPtrArray; // Decaying T removes any reference and gets the correct underlying storage data type
391 };
392
393 //--------------------------------------------------------------------
394 // UStruct cache element
395 //--------------------------------------------------------------------
397 {
399
400 template<typename T>
406
408
409 template<typename T>
410 inline const T& GetData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/, const T& /*Default*/) const
411 {
412 return InstancedStruct.Get<T>();
413 }
414
415 DATAFLOWCORE_API virtual const void* GetUntypedData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/) const override;
416
417 DATAFLOWCORE_API virtual bool IsArray(const IContextCacheStore& Context) const override;
421
423
424 //~ Begin FGCObject interface
426 DATAFLOWCORE_API FString GetReferencerName() const override;
427 //~ End FGCObject interface
428
429 private:
430 FInstancedStruct InstancedStruct;
431 };
432
433 //--------------------------------------------------------------------
434 // UStruct array cache element
435 //--------------------------------------------------------------------
437 {
442
443 // construct from a single struct view into an array
448
449 template<typename T>
456
460
461 virtual ~FContextCacheElementUStructArray() override = default;
462
463 template<typename T>
464 const TArray<T>& GetData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/, const TArray<T>& /*Default*/) const
465 {
466 return InstancedStructArray.Get<T>();
467 }
468
469 virtual const void* GetUntypedData(const IContextCacheStore& /*Context*/, const FProperty* /*PropertyIn*/) const override;
470
471 virtual bool IsArray(const IContextCacheStore& Context) const override;
472 virtual int32 GetNumArrayElements(const IContextCacheStore& Context) const override;
475
477
478 //~ Begin FGCObject interface
480 DATAFLOWCORE_API FString GetReferencerName() const override;
481 //~ End FGCObject interface
482
483 private:
484 FConstStructArrayView GetStructArrayView() const;
485
486 // Implements a FInstancedStruct for arrays (FInstancedStructContainer cannot be cast to a TArray)
487 struct FInstancedStructArray final : private TArray<uint8>
488 {
489 explicit FInstancedStructArray(const UScriptStruct* const InScriptStruct);
490 explicit FInstancedStructArray(const FConstStructView& StructView);
491 explicit FInstancedStructArray(const FConstStructArrayView& StructArrayView);
492 ~FInstancedStructArray();
493
494 // expose parts of the TArray interface that are safe to use directly
495 // Note: otherwise use Get()
497 using TArray<uint8>::Num;
498 using TArray<uint8>::GetData;
499
500 const int32 GetStructureSize() const;
501
502 const UScriptStruct* GetScriptStruct() const;
503
504 FConstStructView GetScriptViewAt(int32 Index) const;
505
506 const void* GetMemory() const;
507
508 void AddReferencedObjects(FReferenceCollector& Collector);
509
510 template<typename T>
511 const TArray<T>& Get() const
512 {
513 check(!ScriptStruct || TBaseStructure<T>::Get() == ScriptStruct);
514 return reinterpret_cast<const TArray<T>&>(*this);
515 }
516
517 template<typename T>
518 TArray<T>& Get()
519 {
520 check(!ScriptStruct || TBaseStructure<T>::Get() == ScriptStruct);
521 return reinterpret_cast<TArray<T>&>(*this);
522 }
523 private:
524 void InitFromRawData(const void* Data, const int32 Num);
525
526 const UScriptStruct* const ScriptStruct;
527 };
528
529 FInstancedStructArray InstancedStructArray;
530 };
531
532 // cache element method implementation
533 template<class T>
535 {
536 // check(PropertyIn->IsA<T>()); // @todo(dataflow) compile error for non-class T; find alternatives
537 if (Type == EType::CacheElementTyped)
538 {
539 if constexpr (!TIsUObjectPtrElement<T>::Value)
540 {
541 return static_cast<const TContextCacheElement<T>&>(*this).GetData(Context, PropertyIn, Default);
542 }
543 }
545 {
546 return static_cast<const FContextCacheElementReference&>(*this).GetData(Context, PropertyIn, Default);
547 }
548 if (Type == EType::CacheElementNull)
549 {
550 return Default;
551 }
553 {
554 if constexpr (TIsTArray<T>::Value)
555 {
557 {
559 }
560 }
561 }
562 if (Type == EType::CacheElementUObject)
563 {
564 if constexpr (TIsUObjectPtrElement<T>::Value)
565 {
566 return static_cast<const TContextCacheElementUObject<T>&>(*this).GetData(Context, PropertyIn, Default);
567 }
568 }
570 {
571 if constexpr (TIsTArray<T>::Value)
572 {
574 {
575 return static_cast<const FContextCacheElementUStructArray&>(*this).GetData<typename T::ElementType>(Context, PropertyIn, Default);
576 }
577 }
578 }
579 if (Type == EType::CacheElementUStruct)
580 {
581 if constexpr (TIsReflectedStruct<T>::Value)
582 {
583 return static_cast<const FContextCacheElementUStruct&>(*this).GetData<T>(Context, PropertyIn, Default);
584 }
585 }
586 check(false); // should never happen
587 return Default;
588 }
589
590 struct FContextCache : public TMap<FContextCacheKey, TUniquePtr<FContextCacheElementBase>>
591 {
593 };
594
595 // cache classes implemetation
596 // this needs to be after the FContext definition because they access its methods
597
602
603 template<class T>
605 {
606 return Data;
607 }
608
609 template<class T>
614
615 template<class T>
617 {
618 if (const TUniquePtr<FContextCacheElementBase>* Cache = Context.FindCacheElement(DataKey))
619 {
620 return (*Cache)->GetTypedData<T>(Context, InProperty, Default);
621 }
622 return Default;
623 }
624
625 template<class T>
630
631 template<class T>
636
638
640 {
641 public:
644
645 DATAFLOWCORE_API int32 Num() const;
648
650
651 private:
652 IContextCacheStore& Context;
653 FContextCacheKey CacheKey; // only set when CacheElement is null
654 TUniquePtr<FContextCacheElementBase> CacheElement; // when CacheKey is define this should be null
655 };
656};
657
660
661
662
663
#define check(expr)
Definition AssertionMacros.h:314
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_FORCEINLINE_HINT TUniquePtr< T > MakeUnique(TArgs &&... Args)
Definition UniquePtr.h:918
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition GCObject.h:128
Definition UnrealType.h:174
Definition UObjectGlobals.h:2492
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_NODEBUG UE_FORCEINLINE_HINT bool IsValidIndex(SizeType Index) const
Definition Array.h:1122
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition Class.h:1720
Definition DataflowAnyType.cpp:10
uint32 FContextCacheKey
Definition DataflowContextCache.h:23
FStringBuilderBase & operator<<(FStringBuilderBase &Builder, const FDerivedData &Data)
Definition DerivedData.cpp:255
U16 Index
Definition radfft.cpp:71
Definition StructArrayView.h:398
Definition StructView.h:217
Definition Guid.h:109
Definition InstancedStruct.h:32
UE_API void InitializeAs(const UScriptStruct *InScriptStruct, const uint8 *InStructMemory=nullptr)
Definition InstancedStruct.cpp:69
const T & Get() const
Definition InstancedStruct.h:185
Definition Class.h:5288
UE::Core::Private::Decay::TDecayNonReference< typenameTRemoveReference< T >::Type >::Type Type
Definition Decay.h:45
Definition Array.h:4015
Definition DataflowContextCache.h:65
virtual ~FContextCacheElementBase()
Definition DataflowContextCache.h:84
virtual bool IsArray(const IContextCacheStore &Context) const =0
void UpdatePropertyAndNodeData(const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp)
Definition DataflowContextCache.h:115
const T & GetTypedData(const IContextCacheStore &Context, const FProperty *PropertyIn, const T &Default) const
Definition DataflowContextCache.h:534
virtual const void * GetUntypedData(const IContextCacheStore &Context, const FProperty *PropertyIn) const =0
const uint32 GetNodeHash() const
Definition DataflowContextCache.h:109
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const =0
TUniquePtr< FContextCacheElementBase > CreateReference(FContextCacheKey InReferenceDataKey) const
Definition DataflowContextCache.h:598
const FGuid & GetNodeGuid() const
Definition DataflowContextCache.h:108
EType
Definition DataflowContextCache.h:67
@ CacheElementNull
Definition DataflowContextCache.h:70
@ CacheElementUObjectArray
Definition DataflowContextCache.h:72
@ CacheElementUStructArray
Definition DataflowContextCache.h:74
@ CacheElementUStruct
Definition DataflowContextCache.h:73
@ CacheElementUObject
Definition DataflowContextCache.h:71
@ CacheElementTyped
Definition DataflowContextCache.h:68
@ CacheElementReference
Definition DataflowContextCache.h:69
FContextCacheElementBase(EType CacheElementType, FGuid InNodeGuid=FGuid(), const FProperty *InProperty=nullptr, uint32 InNodeHash=0, FTimestamp InTimestamp=FTimestamp::Invalid)
Definition DataflowContextCache.h:77
EType GetType() const
Definition DataflowContextCache.h:102
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const =0
void SetProperty(const FProperty *NewProperty)
Definition DataflowContextCache.h:112
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const =0
const FTimestamp & GetTimestamp() const
Definition DataflowContextCache.h:105
void SetTimestamp(const FTimestamp &InTimestamp)
Definition DataflowContextCache.h:106
const FProperty * GetProperty() const
Definition DataflowContextCache.h:104
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const =0
Definition DataflowContextCache.h:245
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:94
virtual bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:74
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:89
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:84
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:79
virtual const void * GetUntypedData(const IContextCacheStore &Context, const FProperty *PropertyIn) const override
Definition DataflowContextCache.cpp:69
FContextCacheElementNull(FGuid InNodeGuid, const FProperty *InProperty, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:255
Definition DataflowContextCache.h:215
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:46
FContextCacheElementReference(FGuid InNodeGuid, const FProperty *InProperty, FContextCacheKey InDataKey, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:216
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:55
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:37
virtual const void * GetUntypedData(const IContextCacheStore &Context, const FProperty *PropertyIn) const override
Definition DataflowContextCache.cpp:10
virtual bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:19
const T & GetData(const IContextCacheStore &Context, const FProperty *PropertyIn, const T &Default) const
Definition DataflowContextCache.h:616
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:28
Definition DataflowContextCache.h:437
FContextCacheElementUStructArray(FGuid InNodeGuid, const FProperty *InProperty, const FConstStructArrayView &InStructArrayView, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:438
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:178
virtual bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:158
virtual ~FContextCacheElementUStructArray() override=default
const TArray< T > & GetData(const IContextCacheStore &, const FProperty *, const TArray< T > &) const
Definition DataflowContextCache.h:464
FContextCacheElementUStructArray(FGuid InNodeGuid, const FProperty *InProperty, TArray< T > &&InStructArray, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:450
DATAFLOWCORE_API void AddReferencedObjects(FReferenceCollector &Collector) override
Definition DataflowContextCache.cpp:188
virtual const void * GetUntypedData(const IContextCacheStore &, const FProperty *) const override
Definition DataflowContextCache.cpp:153
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:163
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:168
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:183
DATAFLOWCORE_API FString GetReferencerName() const override
Definition DataflowContextCache.cpp:193
FContextCacheElementUStructArray(FGuid InNodeGuid, const FProperty *InProperty, const FConstStructView &InStructView, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:444
FContextCacheElementUStructArray(const FContextCacheElementUStructArray &Other)
Definition DataflowContextCache.h:457
Definition DataflowContextCache.h:397
const T & GetData(const IContextCacheStore &, const FProperty *, const T &) const
Definition DataflowContextCache.h:410
virtual DATAFLOWCORE_API int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:121
virtual DATAFLOWCORE_API bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:116
virtual DATAFLOWCORE_API TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:126
FContextCacheElementUStruct(FGuid InNodeGuid, const FProperty *InProperty, T &&InStruct, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:401
DATAFLOWCORE_API FString GetReferencerName() const override
Definition DataflowContextCache.cpp:146
virtual DATAFLOWCORE_API const void * GetUntypedData(const IContextCacheStore &, const FProperty *) const override
Definition DataflowContextCache.cpp:111
virtual DATAFLOWCORE_API TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.cpp:136
virtual DATAFLOWCORE_API TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.cpp:131
DATAFLOWCORE_API void AddReferencedObjects(FReferenceCollector &Collector) override
Definition DataflowContextCache.cpp:141
Definition DataflowContextCache.h:591
Definition DataflowContextCache.h:640
DATAFLOWCORE_API int32 Num() const
Definition DataflowContextCache.cpp:290
DATAFLOWCORE_API FContextValue ToArray() const
Definition DataflowContextCache.cpp:309
DATAFLOWCORE_API FContextValue GetAt(int32 Index) const
Definition DataflowContextCache.cpp:299
DATAFLOWCORE_API const FContextCacheElementBase * GetCacheEntry() const
Definition DataflowContextCache.cpp:331
Definition DataflowContextCache.h:40
static DATAFLOWCORE_API Type Current()
Definition DataflowNodeParameters.cpp:105
bool operator<(const FTimestamp &InTimestamp) const
Definition DataflowContextCache.h:46
uint64 Type
Definition DataflowContextCache.h:41
bool operator>=(const FTimestamp &InTimestamp) const
Definition DataflowContextCache.h:45
bool IsInvalid()
Definition DataflowContextCache.h:48
static DATAFLOWCORE_API Type Invalid
Definition DataflowContextCache.h:52
Type Value
Definition DataflowContextCache.h:42
bool operator==(const FTimestamp &InTimestamp) const
Definition DataflowContextCache.h:47
bool IsInvalid() const
Definition DataflowContextCache.h:49
FTimestamp(Type InValue)
Definition DataflowContextCache.h:44
Definition DataflowContextCache.h:56
virtual const TUniquePtr< FContextCacheElementBase > * FindCacheElement(FContextCacheKey Key) const =0
virtual bool HasCacheElement(FContextCacheKey Key, FTimestamp InTimestamp=FTimestamp::Invalid) const =0
Definition DataflowContextCache.h:333
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:361
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.h:376
const TArray< T > & GetData(const IContextCacheStore &, const FProperty *, const TArray< T > &) const
Definition DataflowContextCache.h:351
virtual FString GetReferencerName() const override
Definition DataflowContextCache.h:385
virtual void AddReferencedObjects(FReferenceCollector &Collector) override
Definition DataflowContextCache.h:384
TContextCacheElementUObjectArray(FGuid InNodeGuid, const FProperty *InProperty, ArrayT &&InObjectPtrArray, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:335
TContextCacheElementUObjectArray(const TContextCacheElementUObjectArray< T > &Other)
Definition DataflowContextCache.h:341
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:632
virtual bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:346
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.h:366
virtual const void * GetUntypedData(const IContextCacheStore &, const FProperty *) const override
Definition DataflowContextCache.h:356
Definition DataflowContextCache.h:274
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:626
virtual void AddReferencedObjects(FReferenceCollector &Collector) override
Definition DataflowContextCache.h:319
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.h:310
virtual const void * GetUntypedData(const IContextCacheStore &, const FProperty *) const override
Definition DataflowContextCache.h:290
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:300
virtual bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:295
const T & GetData(const IContextCacheStore &, const FProperty *, const T &) const
Definition DataflowContextCache.h:285
TContextCacheElementUObject(FGuid InNodeGuid, const FProperty *InProperty, T &&InObjectPtr, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:275
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.h:305
TContextCacheElementUObject(const TContextCacheElementUObject< T > &Other)
Definition DataflowContextCache.h:280
virtual FString GetReferencerName() const override
Definition DataflowContextCache.h:320
Definition DataflowContextCache.h:138
virtual TUniquePtr< FContextCacheElementBase > CreateFromArrayElement(const IContextCacheStore &Context, int32 Index, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.h:173
TContextCacheElement(FGuid InNodeGuid, const FProperty *InProperty, T &&InData, uint32 InNodeHash, FTimestamp Timestamp)
Definition DataflowContextCache.h:139
TContextCacheElement(const TContextCacheElement< T > &Other)
Definition DataflowContextCache.h:144
const T & GetData(const IContextCacheStore &Context, const FProperty *PropertyIn, const T &Default) const
Definition DataflowContextCache.h:604
virtual bool IsArray(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:156
const T & GetDataDirect() const
Definition DataflowContextCache.h:202
virtual TUniquePtr< FContextCacheElementBase > Clone(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:610
virtual TUniquePtr< FContextCacheElementBase > CreateArrayFromElement(const IContextCacheStore &Context, const FProperty *InProperty, const FGuid &InNodeGuid, uint32 InNodeHash, const FTimestamp &InTimestamp) const override
Definition DataflowContextCache.h:189
virtual const void * GetUntypedData(const IContextCacheStore &Context, const FProperty *PropertyIn) const
Definition DataflowContextCache.h:151
virtual int32 GetNumArrayElements(const IContextCacheStore &Context) const override
Definition DataflowContextCache.h:161
Definition DataflowContextCache.h:35
static constexpr bool Value
Definition DataflowContextCache.h:35
Definition DataflowContextCache.h:28
static constexpr bool Value
Definition DataflowContextCache.h:30
TDecay< T >::Type Type
Definition DataflowContextCache.h:29