UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PropertyPathNameTree.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Containers/Map.h"
11
12#define UE_API COREUOBJECT_API
13
14class FBlake3;
15
16namespace UE
17{
18
25{
27 struct FKey
28 {
29 FName Name;
31
32 [[nodiscard]] friend inline bool operator==(const FKey& Lhs, const FKey& Rhs)
33 {
34 return Lhs.Name == Rhs.Name && Lhs.Type == Rhs.Type;
35 }
36
37 [[nodiscard]] friend inline bool operator<(const FKey& Lhs, const FKey& Rhs)
38 {
39 if (int32 Compare = Lhs.Name.Compare(Rhs.Name))
40 {
41 return Compare < 0;
42 }
43 return Lhs.Type < Rhs.Type;
44 }
45
46 [[nodiscard]] friend inline uint32 GetTypeHash(const FKey& Key)
47 {
48 return HashCombineFast(GetTypeHash(Key.Name), GetTypeHash(Key.Type));
49 }
50
51 friend inline void AppendHash(FBlake3& Builder, const FKey& Key)
52 {
53 DispatchAppendHash(Builder, Key.Name);
54 DispatchAppendHash(Builder, Key.Type);
55 }
56 };
57
58 struct FValue
59 {
62 };
63
64public:
66 {
67 const FValue* Value = nullptr;
68 inline explicit operator bool() const { return !!Value; }
69 inline const FPropertyPathNameTree* GetSubTree() const { return Value ? Value->SubTree.Get() : nullptr; }
70 inline const FPropertyTag* GetTag() const { return Value && !Value->Tag.Name.IsNone() ? &Value->Tag : nullptr; }
71 };
72
74 {
78 inline FPropertyTag* GetTag() { return const_cast<FPropertyTag*>(FConstNode::GetTag()); }
79 UE_API void SetTag(const FPropertyTag& Tag);
80 };
81
87
89 inline bool IsEmpty() const { return Nodes.IsEmpty(); }
90
92 UE_API void Empty();
93
95 UE_API FNode Add(const FPropertyPathName& Path, int32 StartIndex = 0);
96
98 UE_API bool Remove(const FPropertyPathName& Path, int32 StartIndex = 0);
99
108 [[nodiscard]] UE_API FNode Find(const FPropertyPathName& Path, int32 StartIndex = 0);
109 [[nodiscard]] inline FConstNode Find(const FPropertyPathName& Path, int32 StartIndex = 0) const
110 {
111 return {const_cast<FPropertyPathNameTree*>(this)->Find(Path, StartIndex).Value};
112 }
113
115 {
116 public:
118 : NodeIt(InNodeIt)
119 {
120 }
121
122 inline FConstIterator& operator++() { ++NodeIt; return *this; }
123
124 inline explicit operator bool() const { return (bool)NodeIt; }
125
126 inline bool operator==(const FConstIterator& Rhs) const { return NodeIt == Rhs.NodeIt; }
127 inline bool operator!=(const FConstIterator& Rhs) const { return NodeIt != Rhs.NodeIt; }
128
129 inline FName GetName() const { return NodeIt.Key().Name; }
130 inline FPropertyTypeName GetType() const { return NodeIt.Key().Type; }
131 inline FConstNode GetNode() const { return {&NodeIt.Value()}; }
132
133 private:
135 };
136
137 [[nodiscard]] inline FConstIterator CreateConstIterator() const { return FConstIterator(Nodes.CreateConstIterator()); }
138
139private:
140 UE_API friend void AppendHash(FBlake3& Builder, const FPropertyPathNameTree& Tree);
141
142 TMap<FKey, FValue> Nodes;
143};
144
145} // UE
146
147#undef UE_API
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
bool operator<(const FTextFormatString &LHS, const FTextFormatString &RHS)
Definition ITextFormatArgumentModifier.h:147
const bool
Definition NetworkReplayStreaming.h:178
#define UE_API
Definition SColorGradingComponentViewer.h:12
constexpr uint32 HashCombineFast(uint32 A, uint32 B)
Definition TypeHash.h:74
void DispatchAppendHash(BuilderType &Builder, const ArgType &Arg)
Definition TypeHash.h:219
void AppendHash(FBlake3 &Builder, FName In)
Definition UnrealNames.cpp:3801
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Blake3.h:94
Definition NameTypes.h:617
FORCEINLINE bool IsNone() const
Definition NameTypes.h:827
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition PropertyPathNameTree.h:115
bool operator!=(const FConstIterator &Rhs) const
Definition PropertyPathNameTree.h:127
FConstNode GetNode() const
Definition PropertyPathNameTree.h:131
FConstIterator & operator++()
Definition PropertyPathNameTree.h:122
FConstIterator(const TMap< FKey, FValue >::TConstIterator &InNodeIt)
Definition PropertyPathNameTree.h:117
bool operator==(const FConstIterator &Rhs) const
Definition PropertyPathNameTree.h:126
FName GetName() const
Definition PropertyPathNameTree.h:129
FPropertyTypeName GetType() const
Definition PropertyPathNameTree.h:130
Definition PropertyPathNameTree.h:25
FPropertyPathNameTree(const FPropertyPathNameTree &)=delete
UE_API void Empty()
Definition PropertyPathNameTree.cpp:12
FPropertyPathNameTree & operator=(const FPropertyPathNameTree &)=delete
FPropertyPathNameTree(FPropertyPathNameTree &&)=default
FConstNode Find(const FPropertyPathName &Path, int32 StartIndex=0) const
Definition PropertyPathNameTree.h:109
UE_API friend void AppendHash(FBlake3 &Builder, const FPropertyPathNameTree &Tree)
Definition PropertyPathNameTree.cpp:104
FPropertyPathNameTree & operator=(FPropertyPathNameTree &&)=default
FConstIterator CreateConstIterator() const
Definition PropertyPathNameTree.h:137
bool IsEmpty() const
Definition PropertyPathNameTree.h:89
Definition PropertyPathName.h:57
Definition PropertyTypeName.h:46
Definition AdvancedWidgetsModule.cpp:13
Definition PropertyTag.h:38
FName Name
Definition PropertyTag.h:49
Definition PropertyPathNameTree.h:66
const FPropertyPathNameTree * GetSubTree() const
Definition PropertyPathNameTree.h:69
const FValue * Value
Definition PropertyPathNameTree.h:67
const FPropertyTag * GetTag() const
Definition PropertyPathNameTree.h:70
Definition PropertyPathNameTree.h:74
UE_API void SetTag(const FPropertyTag &Tag)
Definition PropertyPathNameTree.cpp:82
FPropertyTag * GetTag()
Definition PropertyPathNameTree.h:78
FPropertyPathNameTree * GetSubTree()
Definition PropertyPathNameTree.h:77