UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DataflowContextCachingFactory.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7
8#define UE_API DATAFLOWCORE_API
9
10class FArchive;
11
12namespace UE::Dataflow
13{
25
26 //
27 //
28 //
30 {
32
33 // All Maps indexed by TypeName
34 TMap<FName, FSerializeFunction > CachingMap; // [TypeName] -> Caching Funcitons
35 static UE_API FContextCachingFactory* Instance;
37
38 public:
39 ~FContextCachingFactory() { delete Instance; }
40
42 {
43 if (!Instance)
44 {
45 Instance = new FContextCachingFactory();
46 }
47 return Instance;
48 }
49
50 UE_API void RegisterSerializeFunction(const FName& Type, FSerializeFunction InSerializeFunc);
51
52 template<class T>
54 {
55 // we only support typed cache element and not cache reference
57 {
58 // it is assumed the type requested matches the cache entry
60 return TypedElement->GetDataDirect();
61 }
62 return Default;
63 }
64
65 template<class T>
67 {
68 return new TContextCacheElement<T>(FGuid(), (FProperty*)nullptr, MoveTemp(Data), (uint32)0, FTimestamp::Invalid);
69 }
70
71
73
74 bool Contains(FName InType) const { return CachingMap.Contains(InType); }
75
76 };
77
78}
79
80#undef UE_API
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_API
Definition SColorGradingComponentViewer.h:12
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition NameTypes.h:617
Definition UnrealType.h:174
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition DataflowContextCachingFactory.h:30
bool Contains(FName InType) const
Definition DataflowContextCachingFactory.h:74
static const T & GetTypedElement(const FContextCacheElementBase *InElement, const T &Default)
Definition DataflowContextCachingFactory.h:53
static FContextCacheElementBase * NewTypedElement(T &&Data)
Definition DataflowContextCachingFactory.h:66
~FContextCachingFactory()
Definition DataflowContextCachingFactory.h:39
UE_API void RegisterSerializeFunction(const FName &Type, FSerializeFunction InSerializeFunc)
Definition DataflowContextCachingFactory.cpp:16
static FContextCachingFactory * GetInstance()
Definition DataflowContextCachingFactory.h:41
Definition TypedElementColumnUtils.h:58
Definition DataflowAnyType.cpp:10
Definition Guid.h:109
Definition DataflowContextCachingFactory.h:14
FGuid NodeGuid
Definition DataflowContextCachingFactory.h:20
FContextCacheElementBase * Data
Definition DataflowContextCachingFactory.h:21
FTimestamp Timestamp
Definition DataflowContextCachingFactory.h:23
FName Type
Definition DataflowContextCachingFactory.h:19
FContextCacheData(FName InType, FGuid InNodeGuid, FContextCacheElementBase *InData, uint32 InNodeHash, FTimestamp InTimestamp)
Definition DataflowContextCachingFactory.h:16
uint32 NodeHash
Definition DataflowContextCachingFactory.h:22
Definition DataflowContextCache.h:65
@ CacheElementTyped
Definition DataflowContextCache.h:68
Definition DataflowContextCache.h:40
static DATAFLOWCORE_API Type Invalid
Definition DataflowContextCache.h:52
Definition DataflowContextCache.h:138