Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TMap< InKeyType, InValueType, SetAllocator, KeyFuncs > Class Template Reference

#include <Map.h>

+ Inheritance diagram for TMap< InKeyType, InValueType, SetAllocator, KeyFuncs >:
+ Collaboration diagram for TMap< InKeyType, InValueType, SetAllocator, KeyFuncs >:

Public Types

typedef InKeyType KeyType
 
typedef InValueType ValueType
 
typedef SetAllocator SetAllocatorType
 
typedef KeyFuncs KeyFuncsType
 
typedef TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncsSuper
 
typedef Super::KeyInitType KeyInitType
 
typedef Super::KeyConstPointerType KeyConstPointerType
 
- Public Types inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
typedef TTypeTraits< KeyType >::ConstPointerType KeyConstPointerType
 
typedef TTypeTraits< KeyType >::ConstInitType KeyInitType
 
typedef TTypeTraits< ValueType >::ConstInitType ValueInitType
 
typedef TPair< KeyType, ValueType > ElementType
 
using TRangedForIterator = TBaseIterator<false, true>
 
using TRangedForConstIterator = TBaseIterator<true, true>
 

Public Member Functions

 TMap ()=default
 
 TMap (TMap &&)=default
 
 TMap (const TMap &)=default
 
TMapoperator= (TMap &&)=default
 
TMapoperator= (const TMap &)=default
 
template<typename OtherSetAllocator >
 TMap (TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
 TMap (const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
 TMap (std::initializer_list< TPairInitializer< const KeyType &, const ValueType & > > InitList)
 
template<typename OtherSetAllocator >
TMapoperator= (TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TMapoperator= (const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
TMapoperator= (std::initializer_list< TPairInitializer< const KeyType &, const ValueType & > > InitList)
 
FORCEINLINE bool RemoveAndCopyValue (KeyInitType Key, ValueType &OutRemovedValue)
 
template<typename ComparableKey >
FORCEINLINE bool RemoveAndCopyValueByHash (uint32 KeyHash, const ComparableKey &Key, ValueType &OutRemovedValue)
 
FORCEINLINE ValueType FindAndRemoveChecked (KeyConstPointerType Key)
 
template<typename OtherSetAllocator >
void Append (TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&OtherMap)
 
template<typename OtherSetAllocator >
void Append (const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &OtherMap)
 
FORCEINLINE ValueTypeoperator[] (KeyConstPointerType Key)
 
FORCEINLINE const ValueTypeoperator[] (KeyConstPointerType Key) const
 
- Public Member Functions inherited from TSortableMapBase< InKeyType, InValueType, SetAllocator, KeyFuncs >
FORCEINLINE void KeySort (const PREDICATE_CLASS &Predicate)
 
FORCEINLINE void KeyStableSort (const PREDICATE_CLASS &Predicate)
 
FORCEINLINE void ValueSort (const PREDICATE_CLASS &Predicate)
 
FORCEINLINE void ValueStableSort (const PREDICATE_CLASS &Predicate)
 
void SortFreeList ()
 
- Public Member Functions inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
bool OrderIndependentCompareEqual (const TMapBase &Other) const
 
FORCEINLINE void Empty (int32 ExpectedNumElements=0)
 
FORCEINLINE void Reset ()
 
FORCEINLINE void Shrink ()
 
FORCEINLINE void Compact ()
 
FORCEINLINE void CompactStable ()
 
FORCEINLINE void Reserve (int32 Number)
 
bool IsEmpty () const
 
FORCEINLINE int32 Num () const
 
template<typename Allocator >
int32 GetKeys (TArray< KeyType, Allocator > &OutKeys) const
 
template<typename Allocator >
int32 GetKeys (TSet< KeyType, Allocator > &OutKeys) const
 
FORCEINLINE SIZE_T GetAllocatedSize () const
 
FORCEINLINE void CountBytes (FArchive &Ar) const
 
FORCEINLINE ValueType & Add (const KeyType &InKey, const ValueType &InValue)
 
FORCEINLINE ValueType & Add (const KeyType &InKey, ValueType &&InValue)
 
FORCEINLINE ValueType & Add (KeyType &&InKey, const ValueType &InValue)
 
FORCEINLINE ValueType & Add (KeyType &&InKey, ValueType &&InValue)
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey, const ValueType &InValue)
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey, ValueType &&InValue)
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, KeyType &&InKey, const ValueType &InValue)
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, KeyType &&InKey, ValueType &&InValue)
 
FORCEINLINE ValueType & Add (const KeyType &InKey)
 
FORCEINLINE ValueType & Add (KeyType &&InKey)
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey)
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, KeyType &&InKey)
 
FORCEINLINE ValueType & Add (const TTuple< KeyType, ValueType > &InKeyValue)
 
FORCEINLINE ValueType & Add (TTuple< KeyType, ValueType > &&InKeyValue)
 
template<typename InitKeyType = KeyType, typename InitValueType = ValueType>
ValueType & Emplace (InitKeyType &&InKey, InitValueType &&InValue)
 
template<typename InitKeyType = KeyType, typename InitValueType = ValueType>
ValueType & EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey, InitValueType &&InValue)
 
template<typename InitKeyType = KeyType>
ValueType & Emplace (InitKeyType &&InKey)
 
template<typename InitKeyType = KeyType>
ValueType & EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey)
 
FORCEINLINE int32 Remove (KeyConstPointerType InKey)
 
template<typename ComparableKey >
FORCEINLINE int32 RemoveByHash (uint32 KeyHash, const ComparableKey &Key)
 
const KeyType * FindKey (ValueInitType Value) const
 
template<typename Predicate >
TMap< KeyType, ValueType > FilterByPredicate (Predicate Pred) const
 
FORCEINLINE ValueType * Find (KeyConstPointerType Key)
 
FORCEINLINE const ValueType * Find (KeyConstPointerType Key) const
 
template<typename ComparableKey >
FORCEINLINE ValueType * FindByHash (uint32 KeyHash, const ComparableKey &Key)
 
template<typename ComparableKey >
FORCEINLINE const ValueType * FindByHash (uint32 KeyHash, const ComparableKey &Key) const
 
FORCEINLINE ValueType & FindOrAdd (const KeyType &Key)
 
FORCEINLINE ValueType & FindOrAdd (KeyType &&Key)
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key)
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, KeyType &&Key)
 
FORCEINLINE ValueType & FindOrAdd (const KeyType &Key, const ValueType &Value)
 
FORCEINLINE ValueType & FindOrAdd (const KeyType &Key, ValueType &&Value)
 
FORCEINLINE ValueType & FindOrAdd (KeyType &&Key, const ValueType &Value)
 
FORCEINLINE ValueType & FindOrAdd (KeyType &&Key, ValueType &&Value)
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key, const ValueType &Value)
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key, ValueType &&Value)
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, KeyType &&Key, const ValueType &Value)
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, KeyType &&Key, ValueType &&Value)
 
FORCEINLINE const ValueType & FindChecked (KeyConstPointerType Key) const
 
FORCEINLINE ValueType & FindChecked (KeyConstPointerType Key)
 
FORCEINLINE ValueType FindRef (KeyConstPointerType Key) const
 
FORCEINLINE bool Contains (KeyConstPointerType Key) const
 
template<typename ComparableKey >
FORCEINLINE bool ContainsByHash (uint32 KeyHash, const ComparableKey &Key) const
 
TArray< ElementTypeArray () const
 
template<typename Allocator >
void GenerateKeyArray (TArray< KeyType, Allocator > &OutArray) const
 
template<typename Allocator >
void GenerateValueArray (TArray< ValueType, Allocator > &OutArray) const
 
void Dump (FOutputDevice &Ar)
 
void WriteMemoryImage (FMemoryImageWriter &Writer) const
 
void CopyUnfrozen (const FMemoryUnfreezeContent &Context, void *Dst) const
 
FORCEINLINE TIterator CreateIterator ()
 
FORCEINLINE TConstIterator CreateConstIterator () const
 
FORCEINLINE TKeyIterator CreateKeyIterator (typename TKeyIterator::KeyArgumentType InKey)
 
FORCEINLINE TConstKeyIterator CreateConstKeyIterator (typename TConstKeyIterator::KeyArgumentType InKey) const
 
FORCEINLINE TRangedForIterator begin ()
 
FORCEINLINE TRangedForConstIterator begin () const
 
FORCEINLINE TRangedForIterator end ()
 
FORCEINLINE TRangedForConstIterator end () const
 

Friends

template<typename , typename >
class TScriptMap
 

Additional Inherited Members

- Static Public Member Functions inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
static void AppendHash (const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
 
- Protected Types inherited from TSortableMapBase< InKeyType, InValueType, SetAllocator, KeyFuncs >
typedef TMapBase< InKeyType, InValueType, SetAllocator, KeyFuncsSuper
 
- Protected Types inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
typedef TSet< ElementType, KeyFuncs, SetAllocatorElementSetType
 
- Protected Member Functions inherited from TSortableMapBase< InKeyType, InValueType, SetAllocator, KeyFuncs >
 TSortableMapBase ()=default
 
 TSortableMapBase (TSortableMapBase &&)=default
 
 TSortableMapBase (const TSortableMapBase &)=default
 
 TSortableMapBase (TSortableMapBase< InKeyType, InValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
 TSortableMapBase (const TSortableMapBase< InKeyType, InValueType, OtherSetAllocator, KeyFuncs > &Other)
 
TSortableMapBaseoperator= (TSortableMapBase &&)=default
 
TSortableMapBaseoperator= (const TSortableMapBase &)=default
 
TSortableMapBaseoperator= (TSortableMapBase< InKeyType, InValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
TSortableMapBaseoperator= (const TSortableMapBase< InKeyType, InValueType, OtherSetAllocator, KeyFuncs > &Other)
 
- Protected Member Functions inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
 TMapBase ()=default
 
 TMapBase (TMapBase &&)=default
 
 TMapBase (const TMapBase &)=default
 
TMapBaseoperator= (TMapBase &&)=default
 
TMapBaseoperator= (const TMapBase &)=default
 
template<typename OtherSetAllocator >
 TMapBase (TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
 TMapBase (const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
template<typename OtherSetAllocator >
TMapBaseoperator= (TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TMapBaseoperator= (const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
- Protected Attributes inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
ElementSetType Pairs
 

Detailed Description

template<typename InKeyType, typename InValueType, typename SetAllocator, typename KeyFuncs>
class TMap< InKeyType, InValueType, SetAllocator, KeyFuncs >

A TMapBase specialization that only allows a single value associated with each key.

Definition at line 1101 of file Map.h.

Member Typedef Documentation

◆ KeyConstPointerType

typedef Super::KeyConstPointerType TMap< InKeyType, InValueType, SetAllocator, KeyFuncs >::KeyConstPointerType

Definition at line 1116 of file Map.h.

◆ KeyFuncsType

◆ KeyInitType

Definition at line 1115 of file Map.h.

◆ KeyType

◆ SetAllocatorType

◆ Super

◆ ValueType

Constructor & Destructor Documentation

◆ TMap() [1/6]

◆ TMap() [2/6]

◆ TMap() [3/6]

◆ TMap() [4/6]

Constructor for moving elements from a TMap with a different SetAllocator

Definition at line 1126 of file Map.h.

◆ TMap() [5/6]

Constructor for copying elements from a TMap with a different SetAllocator

Definition at line 1133 of file Map.h.

◆ TMap() [6/6]

Constructor which gets its elements from a native initializer list

Definition at line 1139 of file Map.h.

Member Function Documentation

◆ Append() [1/2]

Add all items from another map to our map (if any keys are in both, the value from the other map wins).

Parameters
OtherMapThe other map of items to add.

Definition at line 1253 of file Map.h.

◆ Append() [2/2]

Move all items from another map into our map (if any keys are in both, the value from the other map wins) and empty the other map.

Parameters
OtherMapThe other map of items to move the elements from.

Definition at line 1235 of file Map.h.

◆ FindAndRemoveChecked()

Find a pair with the specified key, removes it from the map, and returns the value part of the pair.

If no pair was found, an exception is thrown.

Parameters
Keythe key to search for
Returns
whether or not the key was found

Definition at line 1219 of file Map.h.

◆ operator=() [1/5]

◆ operator=() [2/5]

Assignment operator for copying elements from a TMap with a different SetAllocator

Definition at line 1158 of file Map.h.

◆ operator=() [3/5]

Assignment operator which gets its elements from a native initializer list

Definition at line 1165 of file Map.h.

◆ operator=() [4/5]

◆ operator=() [5/5]

Assignment operator for moving elements from a TMap with a different SetAllocator

Definition at line 1150 of file Map.h.

◆ operator[]() [1/2]

◆ operator[]() [2/2]

◆ RemoveAndCopyValue()

Remove the pair with the specified key and copies the value that was removed to the ref parameter

Parameters
KeyThe key to search for
OutRemovedValueIf found, the value that was removed (not modified if the key was not found)
Returns
whether or not the key was found

Definition at line 1183 of file Map.h.

◆ RemoveAndCopyValueByHash()

template<typename ComparableKey >
FORCEINLINE bool TMap< InKeyType, InValueType, SetAllocator, KeyFuncs >::RemoveAndCopyValueByHash ( uint32 KeyHash,
const ComparableKey & Key,
ValueType & OutRemovedValue )
inline

See RemoveAndCopyValue() and class documentation section on ByHash() functions

Definition at line 1198 of file Map.h.

Friends And Related Symbol Documentation

◆ TScriptMap

Definition at line 1104 of file Map.h.


The documentation for this class was generated from the following files: