UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MapBuilder.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"
7#include "Containers/Map.h"
8
16template<typename KeyType, typename ValueType, typename SetAllocator = FDefaultSetAllocator> class TMapBuilder
17{
18public:
19
22 {
23 }
24
30 template<typename OtherAllocator>
35
36public:
37
45 TMapBuilder& Add( KeyType InKey, ValueType InValue )
46 {
47 Map.Add(InKey, InValue);
48
49 return *this;
50 }
51
59 {
60 Map.Append(OtherMap);
61
62 return *this;
63 }
64
65public:
66
76
83 {
84 return Build();
85 }
86
87private:
88
91};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition MapBuilder.h:17
TMapBuilder & Add(KeyType InKey, ValueType InValue)
Definition MapBuilder.h:45
TMap< KeyType, ValueType, SetAllocator > Build()
Definition MapBuilder.h:72
TMapBuilder()
Definition MapBuilder.h:21
TMapBuilder(const TMap< KeyType, ValueType, OtherAllocator > &InMap)
Definition MapBuilder.h:31
TMapBuilder & Append(const TMap< KeyType, ValueType, SetAllocator > &OtherMap)
Definition MapBuilder.h:58
Definition UnrealString.h.inl:34