UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SortedMap.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Map.h"
6#include "Algo/BinarySearch.h"
7#include "Algo/Sort.h"
8#include "UObject/NameTypes.h"
9
18template <typename InKeyType, typename InValueType, typename ArrayAllocator /*= FDefaultAllocator*/, typename SortPredicate /*= TLess<KeyType>*/ >
20{
21 template <typename OtherKeyType, typename OtherValueType, typename OtherArrayAllocator, typename OtherSortPredicate>
22 friend class TSortedMap;
23
24public:
31
32 [[nodiscard]] TSortedMap() = default;
34 [[nodiscard]] TSortedMap(const TSortedMap&) = default;
36 TSortedMap& operator=(const TSortedMap&) = default;
37
39 template<typename OtherArrayAllocator>
44
46 template<typename OtherArrayAllocator>
51
54 {
55 this->Reserve((int32)InitList.size());
57 {
58 this->Add(Element.Key, Element.Value);
59 }
60 }
61
63 // Start - intrusive TOptional<TSortedMap> state //
65 constexpr static bool bHasIntrusiveUnsetOptionalState = true;
67
69 : Pairs(Tag)
70 {
71 }
73 {
74 return Pairs == Tag;
75 }
77 // End - intrusive TOptional<TSortedMap> state //
79
81 template<typename OtherArrayAllocator>
87
89 template<typename OtherArrayAllocator>
95
98 {
99 this->Empty((int32)InitList.size());
101 {
102 this->Add(Element.Key, Element.Value);
103 }
104 return *this;
105 }
106
109 {
110 return Pairs == Other.Pairs;
111 }
112
115 {
116 return Pairs != Other.Pairs;
117 }
118
128
131 {
132 Pairs.Reset();
133 }
134
137 {
138 Pairs.Shrink();
139 }
140
143 {
144 Pairs.Reserve(Number);
145 }
146
153 [[nodiscard]] bool IsEmpty() const
154 {
155 return Pairs.IsEmpty();
156 }
157
160 {
161 return Pairs.Num();
162 }
163
166 {
167 return Pairs.Max();
168 }
169
177 {
178 return Pairs.GetAllocatedSize();
179 }
180
183 {
184 Pairs.CountBytes(Ar);
185 }
186
198
207
215 template <typename InitKeyType = KeyType, typename InitValueType = ValueType>
217 {
218 ElementType* DataPtr = AllocateMemoryForEmplace(InKey);
219
221
222 return DataPtr->Value;
223 }
224
231 template <typename InitKeyType = KeyType>
233 {
234 ElementType* DataPtr = AllocateMemoryForEmplace(InKey);
235
237
238 return DataPtr->Value;
239 }
240
248 {
249 int32 RemoveIndex = FindIndex(InKey);
250
251 if (RemoveIndex == INDEX_NONE)
252 {
253 return 0;
254 }
255
256 Pairs.RemoveAt(RemoveIndex);
257
258 return 1;
259 }
260
268 {
269 for(typename ElementArrayType::TConstIterator PairIt(Pairs);PairIt;++PairIt)
270 {
271 if(PairIt->Value == Value)
272 {
273 return &PairIt->Key;
274 }
275 }
276 return nullptr;
277 }
278
286 {
287 int32 FoundIndex = FindIndex(Key);
288
289 if (FoundIndex != INDEX_NONE)
290 {
291 return &Pairs[FoundIndex].Value;
292 }
293
294 return nullptr;
295 }
296
298 {
299 return const_cast<TSortedMap*>(this)->Find(Key);
300 }
301
309 UE_FORCEINLINE_HINT ValueType& FindOrAdd(const KeyType& Key) { return FindOrAddImpl( Key ); }
310 UE_FORCEINLINE_HINT ValueType& FindOrAdd( KeyType&& Key) { return FindOrAddImpl(MoveTemp(Key)); }
311
319 {
320 ValueType* Value = Find(Key);
321 check(Value != nullptr);
322 return *Value;
323 }
324
326 {
327 const ValueType* Value = Find(Key);
328 check(Value != nullptr);
329 return *Value;
330 }
331
339 {
340 if (const ValueType* Value = Find(Key))
341 {
342 return *Value;
343 }
344
345 return ValueType();
346 }
347
355 [[nodiscard]] inline ValueType FindRef(KeyConstPointerType Key, ValueType DefaultValue) const
356 {
357 if (const ValueType* Value = Find(Key))
358 {
359 return *Value;
360 }
361
362 return DefaultValue;
363 }
364
371 {
372 // The goal of this function is to be fast, and so the implementation may be improved at any time even if it gives different results.
373
374 return Pairs.IsEmpty() ? nullptr : &Pairs.Last();
375 }
377 {
378 return const_cast<TSortedMap*>(this)->FindArbitraryElement();
379 }
380
387 [[nodiscard]] inline bool Contains(KeyConstPointerType Key) const
388 {
389 if (Find(Key))
390 {
391 return true;
392 }
393 return false;
394 }
395
402 template<typename Allocator> int32 GetKeys(TArray<KeyType, Allocator>& OutKeys) const
403 {
404 for (typename ElementArrayType::TConstIterator PairIt(Pairs); PairIt; ++PairIt)
405 {
406 OutKeys.Add(PairIt->Key);
407 }
408
409 return OutKeys.Num();
410 }
411
415 template<typename Allocator> void GenerateKeyArray(TArray<KeyType, Allocator>& OutArray) const
416 {
417 OutArray.Empty(Pairs.Num());
418 for(typename ElementArrayType::TConstIterator PairIt(Pairs);PairIt;++PairIt)
419 {
420 OutArray.Add(PairIt->Key);
421 }
422 }
423
427 template<typename Allocator> void GenerateValueArray(TArray<ValueType, Allocator>& OutArray) const
428 {
429 OutArray.Empty(Pairs.Num());
430 for(typename ElementArrayType::TConstIterator PairIt(Pairs);PairIt;++PairIt)
431 {
432 OutArray.Add(PairIt->Value);
433 }
434 }
435
442 {
443 Pairs.Dump(Ar);
444 }
445
454 {
455 int32 FoundIndex = FindIndex(Key);
456 if (FoundIndex == INDEX_NONE)
457 {
458 return false;
459 }
460
461 OutRemovedValue = MoveTemp(Pairs[FoundIndex].Value);
462 Pairs.RemoveAt(FoundIndex);
463 return true;
464 }
465
474 {
475 int32 FoundIndex = FindIndex(Key);
476 check(FoundIndex != INDEX_NONE);
477
478 ValueType OutRemovedValue = MoveTemp(Pairs[FoundIndex].Value);
479 Pairs.RemoveAt(FoundIndex);
480 return OutRemovedValue;
481 }
482
488 template<typename OtherArrayAllocator, typename OtherSortPredicate>
490 {
491 this->Reserve(this->Num() + OtherMap.Num());
492 for (auto& Pair : OtherMap)
493 {
494 this->Add(MoveTemp(Pair.Key), MoveTemp(Pair.Value));
495 }
496
497 OtherMap.Reset();
498 }
499
505 template<typename OtherArrayAllocator, typename OtherSortPredicate>
507 {
508 this->Reserve(this->Num() + OtherMap.Num());
509 for (auto& Pair : OtherMap)
510 {
511 this->Add(Pair.Key, Pair.Value);
512 }
513 }
514
520 {
521 return this->FindChecked(Key);
522 }
523
524 // Interface functions to match TMap/TSet
525
527 UE_DEPRECATED(5.7 until 5.9, "GetMaxIndex() should be replaced with Num() - 1.")
528 [[nodiscard]] UE_FORCEINLINE_HINT int32 GetMaxIndex() const
529 {
530 // We don't want to deprecate the function entirely, because it should mirror the the existing TMap API, but it's been
531 // returning the wrong value and we want to fix that.
532 //
533 // The deprecation macro lists "5.7 until 5.9", and from 5.9 this function should be de-deprecated and the return value should become "return Pairs.Num();".
534 return Pairs.Num() - 1;
535 }
536
543 {
544 return Pairs.IsValidIndex(Id.AsInteger());
545 }
546
549 {
550 return Pairs[Id.AsInteger()];
551 }
552
555 {
556 return Pairs[Id.AsInteger()];
557 }
558
559private:
560 typedef TArray<ElementType, ArrayAllocator> ElementArrayType;
561
563 template <typename ArgType>
564 [[nodiscard]] inline ValueType& FindOrAddImpl(ArgType&& Key)
565 {
566 if (ValueType* Value = Find(Key))
567 {
568 return *Value;
569 }
570
571 return Add(Forward<ArgType>(Key));
572 }
573
576 {
577 return Algo::BinarySearchBy(Pairs, Key, FKeyForward(), SortPredicate());
578 }
579
581 template <typename InitKeyType>
582 inline ElementType* AllocateMemoryForEmplace(InitKeyType&& InKey)
583 {
584 int32 InsertIndex = Algo::LowerBoundBy(Pairs, InKey, FKeyForward(), SortPredicate());
585 check(InsertIndex >= 0 && InsertIndex <= Pairs.Num());
586
587 ElementType* DataPtr = nullptr;
588 // Since we returned lower bound we already know InKey <= InsertIndex key. So if InKey is not < InsertIndex key, they must be equal
589 if (Pairs.IsValidIndex(InsertIndex) && !SortPredicate()(InKey, Pairs[InsertIndex].Key))
590 {
591 // Replacing element, delete old one
592 DataPtr = Pairs.GetData() + InsertIndex;
593 DestructItems(DataPtr, 1);
594 }
595 else
596 {
597 // Adding new one, this may reallocate Pairs
598 Pairs.InsertUninitialized(InsertIndex, 1);
599 DataPtr = Pairs.GetData() + InsertIndex;
600 }
601
602 return DataPtr;
603 }
604
606 struct FKeyForward
607 {
608 UE_FORCEINLINE_HINT const KeyType& operator()(const ElementType& Pair) const
609 {
610 return Pair.Key;
611 }
612 };
613
615 template<bool bConst>
616 class TBaseIterator
617 {
618 public:
619 typedef std::conditional_t<bConst,typename ElementArrayType::TConstIterator,typename ElementArrayType::TIterator> PairItType;
620 private:
621 typedef std::conditional_t<bConst,const TSortedMap,TSortedMap> MapType;
622 typedef std::conditional_t<bConst,const KeyType,KeyType> ItKeyType;
623 typedef std::conditional_t<bConst,const ValueType,ValueType> ItValueType;
624 typedef std::conditional_t<bConst,const typename ElementArrayType::ElementType, typename ElementArrayType::ElementType> PairType;
625
626 protected:
627 [[nodiscard]] UE_FORCEINLINE_HINT TBaseIterator(const PairItType& InElementIt)
628 : PairIt(InElementIt)
629 {
630 }
631
632 public:
633 UE_FORCEINLINE_HINT TBaseIterator& operator++()
634 {
635 ++PairIt;
636 return *this;
637 }
638
640 [[nodiscard]] UE_FORCEINLINE_HINT explicit operator bool() const
641 {
642 return !!PairIt;
643 }
644
645 [[nodiscard]] UE_FORCEINLINE_HINT bool operator==(const TBaseIterator& Rhs) const
646 {
647 return PairIt == Rhs.PairIt;
648 }
649 [[nodiscard]] UE_FORCEINLINE_HINT bool operator!=(const TBaseIterator& Rhs) const
650 {
651 return PairIt != Rhs.PairIt;
652 }
653
654 UE_FORCEINLINE_HINT ItKeyType& Key() const
655 {
656 return PairIt->Key;
657 }
658 UE_FORCEINLINE_HINT ItValueType& Value() const
659 {
660 return PairIt->Value;
661 }
662
664 {
665 return FSetElementId::FromInteger(PairIt.GetIndex());
666 }
667
668 UE_FORCEINLINE_HINT PairType& operator*() const
669 {
670 return *PairIt;
671 }
672 UE_FORCEINLINE_HINT PairType* operator->() const
673 {
674 return &*PairIt;
675 }
676
677 protected:
678 PairItType PairIt;
679 };
680
682 template<bool bConst>
683 class TBaseReverseIterator
684 {
685 // Once we add reverse iterator to TArray, this class and TBaseIterator could be merged with a template parameter for forward vs reverse.
686 private:
687 typedef std::conditional_t<bConst, const TSortedMap, TSortedMap> MapType;
688 typedef std::conditional_t<bConst, const KeyType, KeyType> ItKeyType;
689 typedef std::conditional_t<bConst, const ValueType, ValueType> ItValueType;
690 typedef typename ElementArrayType::SizeType SizeType;
691
692 public:
693 typedef std::conditional_t<bConst, const typename ElementArrayType::ElementType, typename ElementArrayType::ElementType> PairType;
694
695 protected:
696 [[nodiscard]] UE_FORCEINLINE_HINT TBaseReverseIterator(PairType* InData, SizeType InNum)
697 : Data(InData), Index(InNum-1)
698 {
699 }
700
701 public:
702 inline TBaseReverseIterator& operator++()
703 {
704 checkf(Index != static_cast<SizeType>(-1), TEXT("Incrementing an invalid iterator is illegal"));
705 --Index;
706 return *this;
707 }
708
710 [[nodiscard]] UE_FORCEINLINE_HINT explicit operator bool() const
711 {
712 return Index != static_cast<SizeType>(-1);
713 }
714
715 [[nodiscard]] UE_FORCEINLINE_HINT bool operator==(const TBaseReverseIterator& Rhs) const
716 {
717 return Index == Rhs.Index;
718 }
719 [[nodiscard]] UE_FORCEINLINE_HINT bool operator!=(const TBaseReverseIterator& Rhs) const
720 {
721 return Index != Rhs.Index;
722 }
723
724 UE_FORCEINLINE_HINT ItKeyType& Key() const
725 {
726 return Data[Index].Key;
727 }
728 UE_FORCEINLINE_HINT ItValueType& Value() const
729 {
730 return Data[Index].Value;
731 }
732
734 {
736 }
737
738 UE_FORCEINLINE_HINT PairType& operator*() const
739 {
740 return Data[Index];
741 }
742 UE_FORCEINLINE_HINT PairType* operator->() const
743 {
744 return &Data[Index];
745 }
746
747 protected:
748 PairType* Data;
749 SizeType Index;
750 };
751
753 ElementArrayType Pairs;
754
755public:
756
758 class TIterator : public TBaseIterator<false>
759 {
760 public:
761
763 : TBaseIterator<false>(InMap.Pairs.CreateIterator())
764 {
765 }
766
767 [[nodiscard]] UE_FORCEINLINE_HINT TIterator(const typename TBaseIterator<false>::PairItType& InPairIt)
768 : TBaseIterator<false>(InPairIt)
769 {
770 }
771
774 {
775 TBaseIterator<false>::PairIt.RemoveCurrent();
776 }
777 };
778
780 class TConstIterator : public TBaseIterator<true>
781 {
782 public:
784 : TBaseIterator<true>(InMap.Pairs.CreateConstIterator())
785 {
786 }
787
788 [[nodiscard]] UE_FORCEINLINE_HINT TConstIterator(const typename TBaseIterator<true>::PairItType& InPairIt)
789 : TBaseIterator<true>(InPairIt)
790 {
791 }
792 };
793
795 class TReverseIterator : public TBaseReverseIterator<false>
796 {
797 public:
799 : TBaseReverseIterator<false>(InMap.Pairs.GetData(), InMap.Pairs.Num())
800 {
801 }
802
803 // Add constructor from PairItType and RemoveCurrent once we have reverse iterators on TArray
804 };
805
807 class TConstReverseIterator : public TBaseReverseIterator<true>
808 {
809 public:
811 : TBaseReverseIterator<true>(InMap.Pairs.GetData(), InMap.Pairs.Num())
812 {
813 }
814
815 // Add constructor from PairItType once we have reverse iterators on TArray
816 };
817
819 class TConstKeyIterator : public TBaseIterator<true>
820 {
821 using Super = TBaseIterator<true>;
822
823 public:
825 : Super(InMap.Pairs.CreateConstIterator())
826 {
827 int32 NewIndex = InMap.FindIndex(InKey);
828
829 if (NewIndex != INDEX_NONE)
830 {
831 Super::PairIt += NewIndex;
832 }
833 else
834 {
835 Super::PairIt.SetToEnd();
836 }
837 }
838
840 {
841 Super::PairIt.SetToEnd();
842 return *this;
843 }
844 };
845
847 class TKeyIterator : public TBaseIterator<false>
848 {
849 using Super = TBaseIterator<false>;
850
851 public:
853 : Super(InMap.Pairs.CreateIterator())
854 {
855 int32 NewIndex = InMap.FindIndex(InKey);
856
857 if (NewIndex != INDEX_NONE)
858 {
859 Super::PairIt += NewIndex;
860 }
861 else
862 {
863 Super::PairIt.SetToEnd();
864 }
865 }
866
868 {
869 Super::PairIt.SetToEnd();
870 return *this;
871 }
872
874 inline void RemoveCurrent()
875 {
876 Super::PairIt.RemoveCurrent();
877 Super::PairIt.SetToEnd();
878 }
879 };
880
883 {
884 return TIterator(*this);
885 }
886
892
898
904
908
909public:
915 [[nodiscard]] UE_FORCEINLINE_HINT RangedForConstIteratorType begin() const { return Pairs.begin(); }
918
920};
921
923
925{
926 template <typename KeyType, typename ValueType, typename ArrayAllocator, typename SortPredicate>
928 {
929 Ar << Map.Pairs;
930
931 if (Ar.IsLoading())
932 {
933 // We need to resort, in case the sorting is not consistent with what it was before
935 }
936 }
937};
938
940template <typename KeyType, typename ValueType, typename ArrayAllocator, typename SortPredicate>
946
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
FORCEINLINE constexpr void DestructItems(ElementType *Element, SizeType Count)
Definition MemoryOps.h:81
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define DECLARE_TEMPLATE_INTRINSIC_TYPE_LAYOUT(TemplatePrefix, T)
Definition MemoryLayout.h:661
bool SortPredicate(const FCompileOnTheFlyData &A, const FCompileOnTheFlyData &B)
Definition MovieSceneCompiledDataManager.cpp:364
const bool
Definition NetworkReplayStreaming.h:178
FArchive & operator<<(FArchive &Ar, TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate > &Map)
Definition SortedMap.h:941
auto GetData(const TStringConversion< Converter, DefaultConversionSize > &Conversion) -> decltype(Conversion.Get())
Definition StringConv.h:802
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
Definition OutputDevice.h:133
Definition SetUtilities.h:95
static UE_FORCEINLINE_HINT FSetElementId FromInteger(int32 Integer)
Definition SetUtilities.h:121
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
UE_NODEBUG UE_FORCEINLINE_HINT void InsertUninitialized(SizeType Index)
Definition Array.h:1782
void RemoveAt(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2083
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_REWRITE SizeType Max() const
Definition Array.h:1161
typename InAllocatorType::SizeType SizeType
Definition Array.h:675
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
UE_NODEBUG UE_FORCEINLINE_HINT bool IsValidIndex(SizeType Index) const
Definition Array.h:1122
UE_NODEBUG void CountBytes(FArchive &Ar) const
Definition Array.h:1649
UE_NODEBUG UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition Array.h:1059
UE_FORCEINLINE_HINT void Shrink()
Definition Array.h:1278
void Empty(SizeType Slack=0)
Definition Array.h:2273
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition Array.h:64
Definition Map.h:57
Definition Map.h:26
Definition SortedMap.h:781
UE_FORCEINLINE_HINT TConstIterator(const typename TBaseIterator< true >::PairItType &InPairIt)
Definition SortedMap.h:788
UE_FORCEINLINE_HINT TConstIterator(const TSortedMap &InMap)
Definition SortedMap.h:783
Definition SortedMap.h:820
TConstKeyIterator(const TSortedMap &InMap, KeyInitType InKey)
Definition SortedMap.h:824
TConstKeyIterator & operator++()
Definition SortedMap.h:839
Definition SortedMap.h:808
UE_FORCEINLINE_HINT TConstReverseIterator(const TSortedMap &InMap)
Definition SortedMap.h:810
Definition SortedMap.h:759
UE_FORCEINLINE_HINT void RemoveCurrent()
Definition SortedMap.h:773
UE_FORCEINLINE_HINT TIterator(const typename TBaseIterator< false >::PairItType &InPairIt)
Definition SortedMap.h:767
UE_FORCEINLINE_HINT TIterator(TSortedMap &InMap)
Definition SortedMap.h:762
Definition SortedMap.h:848
TKeyIterator & operator++()
Definition SortedMap.h:867
TKeyIterator(TSortedMap &InMap, KeyInitType InKey)
Definition SortedMap.h:852
void RemoveCurrent()
Definition SortedMap.h:874
Definition SortedMap.h:796
UE_FORCEINLINE_HINT TReverseIterator(TSortedMap &InMap)
Definition SortedMap.h:798
Definition SortedMap.h:20
void Dump(FOutputDevice &Ar)
Definition SortedMap.h:441
TSortedMap & operator=(TSortedMap &&)=default
UE_FORCEINLINE_HINT ValueType & Add(const KeyType &InKey, ValueType &&InValue)
Definition SortedMap.h:195
UE_FORCEINLINE_HINT void Shrink()
Definition SortedMap.h:136
UE_FORCEINLINE_HINT ValueType & Add(const KeyType &InKey, const ValueType &InValue)
Definition SortedMap.h:194
ValueType * Find(KeyConstPointerType Key)
Definition SortedMap.h:285
UE_FORCEINLINE_HINT bool IsValidId(FSetElementId Id) const
Definition SortedMap.h:542
ElementArrayType::RangedForConstIteratorType RangedForConstIteratorType
Definition SortedMap.h:907
UE_FORCEINLINE_HINT int32 Max() const
Definition SortedMap.h:165
InValueType ValueType
Definition SortedMap.h:26
UE_FORCEINLINE_HINT RangedForIteratorType end()
Definition SortedMap.h:916
UE_FORCEINLINE_HINT const ValueType & operator[](KeyConstPointerType Key) const
Definition SortedMap.h:519
UE_FORCEINLINE_HINT ValueType & FindOrAdd(KeyType &&Key)
Definition SortedMap.h:310
ValueType FindRef(KeyConstPointerType Key, ValueType DefaultValue) const
Definition SortedMap.h:355
UE_FORCEINLINE_HINT ValueType & operator[](KeyConstPointerType Key)
Definition SortedMap.h:515
TSortedMap(const TSortedMap< KeyType, ValueType, OtherArrayAllocator, SortPredicate > &Other)
Definition SortedMap.h:47
void GenerateValueArray(TArray< ValueType, Allocator > &OutArray) const
Definition SortedMap.h:427
UE_FORCEINLINE_HINT ValueType & Add(KeyType &&InKey, const ValueType &InValue)
Definition SortedMap.h:196
UE_FORCEINLINE_HINT const ElementType & Get(FSetElementId Id) const
Definition SortedMap.h:554
static constexpr bool bHasIntrusiveUnsetOptionalState
Definition SortedMap.h:65
UE_FORCEINLINE_HINT void CountBytes(FArchive &Ar) const
Definition SortedMap.h:182
TSortedMap(TSortedMap &&)=default
UE_FORCEINLINE_HINT ValueType & Add(KeyType &&InKey)
Definition SortedMap.h:206
ElementArrayType::RangedForIteratorType RangedForIteratorType
Definition SortedMap.h:906
UE_DEPRECATED(5.7 until 5.9, "GetMaxIndex() should be replaced with Num() - 1.") UE_FORCEINLINE_HINT int32 GetMaxIndex() const
Definition SortedMap.h:527
UE_FORCEINLINE_HINT ValueType & Add(const KeyType &InKey)
Definition SortedMap.h:205
TPair< KeyType, ValueType > ElementType
Definition SortedMap.h:30
UE_FORCEINLINE_HINT RangedForConstIteratorType end() const
Definition SortedMap.h:917
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize() const
Definition SortedMap.h:176
InKeyType KeyType
Definition SortedMap.h:25
TTypeTraits< KeyType >::ConstPointerType KeyConstPointerType
Definition SortedMap.h:27
ValueType FindAndRemoveChecked(KeyConstPointerType Key)
Definition SortedMap.h:473
UE_FORCEINLINE_HINT bool operator==(const TSortedMap &Other) const
Definition SortedMap.h:108
UE_FORCEINLINE_HINT void Empty(int32 ExpectedNumElements=0)
Definition SortedMap.h:124
ValueType & Emplace(InitKeyType &&InKey)
Definition SortedMap.h:232
UE_FORCEINLINE_HINT ValueType & Add(KeyType &&InKey, ValueType &&InValue)
Definition SortedMap.h:197
UE_FORCEINLINE_HINT RangedForIteratorType begin()
Definition SortedMap.h:914
TSortedMap & operator=(TSortedMap< KeyType, ValueType, OtherArrayAllocator, SortPredicate > &&Other)
Definition SortedMap.h:82
UE_FORCEINLINE_HINT TIterator CreateIterator()
Definition SortedMap.h:882
void GenerateKeyArray(TArray< KeyType, Allocator > &OutArray) const
Definition SortedMap.h:415
const KeyType * FindKey(ValueInitType Value) const
Definition SortedMap.h:267
const ElementType * FindArbitraryElement() const
Definition SortedMap.h:376
TSortedMap(TSortedMap< KeyType, ValueType, OtherArrayAllocator, SortPredicate > &&Other)
Definition SortedMap.h:40
bool operator==(FIntrusiveUnsetOptionalState Tag) const
Definition SortedMap.h:72
ValueType & Emplace(InitKeyType &&InKey, InitValueType &&InValue)
Definition SortedMap.h:216
UE_FORCEINLINE_HINT TConstIterator CreateConstIterator() const
Definition SortedMap.h:888
UE_FORCEINLINE_HINT RangedForConstIteratorType begin() const
Definition SortedMap.h:915
UE_FORCEINLINE_HINT bool operator!=(const TSortedMap &Other) const
Definition SortedMap.h:114
TSortedMap(FIntrusiveUnsetOptionalState Tag)
Definition SortedMap.h:68
TSortedMap & operator=(const TSortedMap &)=default
TTypeTraits< KeyType >::ConstInitType KeyInitType
Definition SortedMap.h:28
bool IsEmpty() const
Definition SortedMap.h:153
ValueType FindRef(KeyConstPointerType Key) const
Definition SortedMap.h:338
UE_FORCEINLINE_HINT const ValueType * Find(KeyConstPointerType Key) const
Definition SortedMap.h:297
bool RemoveAndCopyValue(KeyInitType Key, ValueType &OutRemovedValue)
Definition SortedMap.h:453
ValueType & FindChecked(KeyConstPointerType Key)
Definition SortedMap.h:318
UE_FORCEINLINE_HINT TConstKeyIterator CreateConstKeyIterator(KeyInitType InKey) const
Definition SortedMap.h:900
TSortedMap(const TSortedMap &)=default
TSortedMap & operator=(std::initializer_list< TPairInitializer< const KeyType &, const ValueType & > > InitList)
Definition SortedMap.h:97
TTypeTraits< ValueType >::ConstInitType ValueInitType
Definition SortedMap.h:29
int32 GetKeys(TArray< KeyType, Allocator > &OutKeys) const
Definition SortedMap.h:402
void Append(TSortedMap< KeyType, ValueType, OtherArrayAllocator, OtherSortPredicate > &&OtherMap)
Definition SortedMap.h:489
friend class TSortedMap
Definition SortedMap.h:22
UE_FORCEINLINE_HINT void Reserve(int32 Number)
Definition SortedMap.h:142
void Append(const TSortedMap< KeyType, ValueType, OtherArrayAllocator, OtherSortPredicate > &OtherMap)
Definition SortedMap.h:506
UE_FORCEINLINE_HINT int32 Num() const
Definition SortedMap.h:159
TSortedMap(std::initializer_list< TPairInitializer< const KeyType &, const ValueType & > > InitList)
Definition SortedMap.h:53
UE_FORCEINLINE_HINT void Reset()
Definition SortedMap.h:130
ElementType * FindArbitraryElement()
Definition SortedMap.h:370
TSortedMap()=default
TSortedMap & operator=(const TSortedMap< KeyType, ValueType, OtherArrayAllocator, SortPredicate > &Other)
Definition SortedMap.h:90
const ValueType & FindChecked(KeyConstPointerType Key) const
Definition SortedMap.h:325
UE_FORCEINLINE_HINT ValueType & FindOrAdd(const KeyType &Key)
Definition SortedMap.h:309
int32 Remove(KeyConstPointerType InKey)
Definition SortedMap.h:247
UE_FORCEINLINE_HINT TKeyIterator CreateKeyIterator(KeyInitType InKey)
Definition SortedMap.h:894
bool Contains(KeyConstPointerType Key) const
Definition SortedMap.h:387
UE_FORCEINLINE_HINT ElementType & Get(FSetElementId Id)
Definition SortedMap.h:548
UE_REWRITE void SortBy(RangeType &&Range, ProjectionType Proj)
Definition Sort.h:40
UE_REWRITE auto LowerBoundBy(const RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
Definition BinarySearch.h:113
auto BinarySearchBy(const RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
Definition BinarySearch.h:203
GeometryCollection::Facades::FMuscleActivationData Data
Definition MuscleActivationConstraints.h:15
FVector operator*(const FSquareMatrix3 &InMatrix, const FVector &InVector)
Definition ARBlueprintLibrary.cpp:650
bool operator!=(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:506
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
FORCEINLINE UE_STRING_CLASS RhsType && Rhs
Definition String.cpp.inl:718
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition IntrusiveUnsetOptionalState.h:71
Definition Array.h:206
Definition SortedMap.h:925
static void Serialize(FArchive &Ar, TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate > &Map)
Definition SortedMap.h:927
Definition Tuple.h:652
TCallTraits< T >::ParamType ConstInitType
Definition UnrealTypeTraits.h:336
TCallTraits< T >::ConstPointerType ConstPointerType
Definition UnrealTypeTraits.h:337