Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
TMap< KeyType, ValueType, SetAllocator, KeyFuncs > Class Template Reference

#include <Map.h>

+ Inheritance diagram for TMap< KeyType, ValueType, SetAllocator, KeyFuncs >:
+ Collaboration diagram for TMap< KeyType, ValueType, SetAllocator, KeyFuncs >:

Public Types

typedef TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs > Super
 
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)
 
template<typename OtherSetAllocator >
TMapoperator= (TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TMapoperator= (const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
FORCEINLINE bool RemoveAndCopyValue (KeyInitType 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 ValueType & operator[] (KeyConstPointerType Key)
 
FORCEINLINE const ValueType & operator[] (KeyConstPointerType Key) const
 
- Public Member Functions inherited from TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
template<typename PREDICATE_CLASS >
FORCEINLINE void KeySort (const PREDICATE_CLASS &Predicate)
 
template<typename PREDICATE_CLASS >
FORCEINLINE void ValueSort (const PREDICATE_CLASS &Predicate)
 
- 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)
 
FORCEINLINE int32 Num () const
 
template<typename Allocator >
int32 GetKeys (TArray< KeyType, Allocator > &OutKeys) const
 
FORCEINLINE uint32 GetAllocatedSize () 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 & Add (const KeyType &InKey)
 
FORCEINLINE ValueType & Add (KeyType &&InKey)
 
template<typename InitKeyType , typename InitValueType >
ValueType & Emplace (InitKeyType &&InKey, InitValueType &&InValue)
 
template<typename InitKeyType >
ValueType & Emplace (InitKeyType &&InKey)
 
FORCEINLINE int32 Remove (KeyConstPointerType InKey)
 
const KeyType * FindKey (ValueInitType Value) const
 
FORCEINLINE ValueType * Find (KeyConstPointerType Key)
 
FORCEINLINE const ValueType * Find (KeyConstPointerType Key) const
 
FORCEINLINE ValueType & FindOrAdd (const KeyType &Key)
 
FORCEINLINE ValueType & FindOrAdd (KeyType &&Key)
 
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 Allocator >
void GenerateKeyArray (TArray< KeyType, Allocator > &OutArray) const
 
template<typename Allocator >
void GenerateValueArray (TArray< ValueType, Allocator > &OutArray) const
 
FORCEINLINE TIterator CreateIterator ()
 
FORCEINLINE TConstIterator CreateConstIterator () const
 
FORCEINLINE TKeyIterator CreateKeyIterator (KeyInitType InKey)
 
FORCEINLINE TConstKeyIterator CreateConstKeyIterator (KeyInitType InKey) const
 

Friends

struct TContainerTraits< TMap >
 
class FScriptMap
 

Additional Inherited Members

- Protected Types inherited from TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
typedef TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs > Super
 
- Protected Types inherited from TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
typedef TSet< ElementType, KeyFuncs, SetAllocator > ElementSetType
 
- Protected Member Functions inherited from TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
 TSortableMapBase ()=default
 
 TSortableMapBase (TSortableMapBase &&)=default
 
 TSortableMapBase (const TSortableMapBase &)=default
 
TSortableMapBaseoperator= (TSortableMapBase &&)=default
 
TSortableMapBaseoperator= (const TSortableMapBase &)=default
 
template<typename OtherSetAllocator >
 TSortableMapBase (TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
 TSortableMapBase (const TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
template<typename OtherSetAllocator >
TSortableMapBaseoperator= (TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TSortableMapBaseoperator= (const TSortableMapBase< KeyType, ValueType, 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 KeyType, typename ValueType, typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
class TMap< KeyType, ValueType, SetAllocator, KeyFuncs >

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

Definition at line 855 of file Map.h.

Member Typedef Documentation

◆ KeyConstPointerType

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
typedef Super::KeyConstPointerType TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::KeyConstPointerType

Definition at line 865 of file Map.h.

◆ KeyInitType

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
typedef Super::KeyInitType TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::KeyInitType

Definition at line 864 of file Map.h.

◆ Super

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
typedef TSortableMapBase<KeyType, ValueType, SetAllocator, KeyFuncs> TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Super

Definition at line 863 of file Map.h.

Constructor & Destructor Documentation

◆ TMap() [1/5]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMap ( )
default

◆ TMap() [2/5]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMap ( TMap< KeyType, ValueType, SetAllocator, KeyFuncs > && )
default

◆ TMap() [3/5]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMap ( const TMap< KeyType, ValueType, SetAllocator, KeyFuncs > & )
default

◆ TMap() [4/5]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
template<typename OtherSetAllocator >
TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMap ( TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && Other)
inline

Constructor for moving elements from a TMap with a different SetAllocator

Definition at line 887 of file Map.h.

◆ TMap() [5/5]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
template<typename OtherSetAllocator >
TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMap ( const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & Other)
inline

Constructor for copying elements from a TMap with a different SetAllocator

Definition at line 894 of file Map.h.

Member Function Documentation

◆ Append() [1/2]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
template<typename OtherSetAllocator >
void TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Append ( const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & OtherMap)
inline

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 976 of file Map.h.

◆ Append() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
template<typename OtherSetAllocator >
void TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Append ( TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && OtherMap)
inline

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 958 of file Map.h.

◆ FindAndRemoveChecked()

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
FORCEINLINE ValueType TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::FindAndRemoveChecked ( KeyConstPointerType Key)
inline

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 942 of file Map.h.

◆ operator=() [1/4]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
TMap & TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( const TMap< KeyType, ValueType, SetAllocator, KeyFuncs > & )
default

◆ operator=() [2/4]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
template<typename OtherSetAllocator >
TMap & TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( const TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & Other)
inline

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

Definition at line 909 of file Map.h.

◆ operator=() [3/4]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
TMap & TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( TMap< KeyType, ValueType, SetAllocator, KeyFuncs > && )
default

◆ operator=() [4/4]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
template<typename OtherSetAllocator >
TMap & TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( TMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && Other)
inline

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

Definition at line 901 of file Map.h.

◆ operator[]() [1/2]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
FORCEINLINE ValueType & TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator[] ( KeyConstPointerType Key)
inline

Definition at line 985 of file Map.h.

◆ operator[]() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
FORCEINLINE const ValueType & TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator[] ( KeyConstPointerType Key) const
inline

Definition at line 986 of file Map.h.

◆ RemoveAndCopyValue()

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
FORCEINLINE bool TMap< KeyType, ValueType, SetAllocator, KeyFuncs >::RemoveAndCopyValue ( KeyInitType Key,
ValueType & OutRemovedValue )
inline

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 923 of file Map.h.

Friends And Related Symbol Documentation

◆ FScriptMap

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
friend class FScriptMap
friend

Definition at line 858 of file Map.h.

◆ TContainerTraits< TMap >

template<typename KeyType , typename ValueType , typename SetAllocator = FDefaultSetAllocator, typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>>
friend struct TContainerTraits< TMap >
friend

Definition at line 844 of file Map.h.


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