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

#include <Map.h>

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

Public Types

typedef TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs > Super
 
typedef Super::KeyConstPointerType KeyConstPointerType
 
typedef Super::KeyInitType KeyInitType
 
typedef Super::ValueInitType ValueInitType
 
- 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

 TMultiMap ()=default
 
 TMultiMap (TMultiMap &&)=default
 
 TMultiMap (const TMultiMap &)=default
 
TMultiMapoperator= (TMultiMap &&)=default
 
TMultiMapoperator= (const TMultiMap &)=default
 
template<typename OtherSetAllocator >
 TMultiMap (TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
 TMultiMap (const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
template<typename OtherSetAllocator >
TMultiMapoperator= (TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TMultiMapoperator= (const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
template<typename Allocator >
void MultiFind (KeyInitType Key, TArray< ValueType, Allocator > &OutValues, bool bMaintainOrder=false) const
 
template<typename Allocator >
void MultiFindPointer (KeyInitType Key, TArray< const ValueType *, Allocator > &OutValues, bool bMaintainOrder=false) const
 
template<typename Allocator >
void MultiFindPointer (KeyInitType Key, TArray< ValueType *, Allocator > &OutValues, bool bMaintainOrder=false)
 
FORCEINLINE ValueType & AddUnique (const KeyType &InKey, const ValueType &InValue)
 
FORCEINLINE ValueType & AddUnique (const KeyType &InKey, ValueType &&InValue)
 
FORCEINLINE ValueType & AddUnique (KeyType &&InKey, const ValueType &InValue)
 
FORCEINLINE ValueType & AddUnique (KeyType &&InKey, ValueType &&InValue)
 
template<typename InitKeyType , typename InitValueType >
ValueType & EmplaceUnique (InitKeyType &&InKey, InitValueType &&InValue)
 
FORCEINLINE int32 Remove (KeyConstPointerType InKey)
 
int32 Remove (KeyInitType InKey, ValueInitType InValue)
 
int32 RemoveSingle (KeyInitType InKey, ValueInitType InValue)
 
FORCEINLINE const ValueType * FindPair (KeyInitType Key, ValueInitType Value) const
 
ValueType * FindPair (KeyInitType Key, ValueInitType Value)
 
int32 Num (KeyInitType Key) const
 
FORCEINLINE int32 Num () 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< TMultiMap >
 

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, typename KeyFuncs>
class TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >

A TMapBase specialization that allows multiple values to be associated with each key.

Definition at line 992 of file Map.h.

Member Typedef Documentation

◆ KeyConstPointerType

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
typedef Super::KeyConstPointerType TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::KeyConstPointerType

Definition at line 1000 of file Map.h.

◆ KeyInitType

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
typedef Super::KeyInitType TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::KeyInitType

Definition at line 1001 of file Map.h.

◆ Super

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
typedef TSortableMapBase<KeyType, ValueType, SetAllocator, KeyFuncs> TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Super

Definition at line 999 of file Map.h.

◆ ValueInitType

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
typedef Super::ValueInitType TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::ValueInitType

Definition at line 1002 of file Map.h.

Constructor & Destructor Documentation

◆ TMultiMap() [1/5]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMultiMap ( )
default

◆ TMultiMap() [2/5]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMultiMap ( TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs > && )
default

◆ TMultiMap() [3/5]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMultiMap ( const TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs > & )
default

◆ TMultiMap() [4/5]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMultiMap ( TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && Other)
inline

Constructor for moving elements from a TMap with a different SetAllocator

Definition at line 1024 of file Map.h.

◆ TMultiMap() [5/5]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::TMultiMap ( const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & Other)
inline

Constructor for copying elements from a TMap with a different SetAllocator

Definition at line 1031 of file Map.h.

Member Function Documentation

◆ AddUnique() [1/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::AddUnique ( const KeyType & InKey,
const ValueType & InValue )
inline

Add a key-value association to the map. The association doesn't replace any of the key's existing associations. However, if both the key and value match an existing association in the map, no new association is made and the existing association's value is returned.

Parameters
InKeyThe key to associate.
InValueThe value to associate.
Returns
A reference to the value as stored in the map; the reference is only valid until the next change to any key in the map.

Definition at line 1114 of file Map.h.

◆ AddUnique() [2/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::AddUnique ( const KeyType & InKey,
ValueType && InValue )
inline

Definition at line 1115 of file Map.h.

◆ AddUnique() [3/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::AddUnique ( KeyType && InKey,
const ValueType & InValue )
inline

Definition at line 1116 of file Map.h.

◆ AddUnique() [4/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::AddUnique ( KeyType && InKey,
ValueType && InValue )
inline

Definition at line 1117 of file Map.h.

◆ EmplaceUnique()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename InitKeyType , typename InitValueType >
ValueType & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::EmplaceUnique ( InitKeyType && InKey,
InitValueType && InValue )
inline

Add a key-value association to the map.

The association doesn't replace any of the key's existing associations. However, if both key and value match an existing association in the map, no new association is made and the existing association's value is returned.

Parameters
InKeyThe key to associate.
InValueThe value to associate.
Returns
A reference to the value as stored in the map; the reference is only valid until the next change to any key in the map.

Definition at line 1131 of file Map.h.

◆ FindPair() [1/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
ValueType * TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::FindPair ( KeyInitType Key,
ValueInitType Value )
inline

Find an association between a specified key and value.

Parameters
KeyThe key to find.
ValueThe value to find.
Returns
If the map contains a matching association, a pointer to the value in the map is returned. Otherwise nullptr is returned. The pointer is only valid as long as the map isn't changed.

Definition at line 1223 of file Map.h.

◆ FindPair() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE const ValueType * TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::FindPair ( KeyInitType Key,
ValueInitType Value ) const
inline

Find an association between a specified key and value. (const)

Parameters
KeyThe key to find.
ValueThe value to find.
Returns
If the map contains a matching association, a pointer to the value in the map is returned. Otherwise nullptr is returned. The pointer is only valid as long as the map isn't changed.

Definition at line 1210 of file Map.h.

◆ MultiFind()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename Allocator >
void TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::MultiFind ( KeyInitType Key,
TArray< ValueType, Allocator > & OutValues,
bool bMaintainOrder = false ) const
inline

Finds all values associated with the specified key.

Parameters
KeyThe key to find associated values for.
OutValuesUpon return, contains the values associated with the key.
bMaintainOrdertrue if the Values array should be in the same order as the map's pairs.

Definition at line 1059 of file Map.h.

◆ MultiFindPointer() [1/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename Allocator >
void TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::MultiFindPointer ( KeyInitType Key,
TArray< const ValueType *, Allocator > & OutValues,
bool bMaintainOrder = false ) const
inline

Finds all values associated with the specified key.

Parameters
KeyThe key to find associated values for.
OutValuesUpon return, contains pointers to the values associated with the key. Pointers are only valid until the next change to any key in the map.
bMaintainOrdertrue if the Values array should be in the same order as the map's pairs.

Definition at line 1080 of file Map.h.

◆ MultiFindPointer() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename Allocator >
void TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::MultiFindPointer ( KeyInitType Key,
TArray< ValueType *, Allocator > & OutValues,
bool bMaintainOrder = false )
inline

Definition at line 1092 of file Map.h.

◆ Num() [1/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE int32 TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Num ( ) const
inline

Definition at line 1251 of file Map.h.

◆ Num() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
int32 TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Num ( KeyInitType Key) const
inline

Returns the number of values within this map associated with the specified key

Definition at line 1239 of file Map.h.

◆ operator=() [1/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TMultiMap & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( const TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs > & )
default

◆ operator=() [2/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMultiMap & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & Other)
inline

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

Definition at line 1046 of file Map.h.

◆ operator=() [3/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TMultiMap & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs > && )
default

◆ operator=() [4/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMultiMap & TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && Other)
inline

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

Definition at line 1038 of file Map.h.

◆ Remove() [1/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE int32 TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Remove ( KeyConstPointerType InKey)
inline

Remove all value associations for a key.

Parameters
InKeyThe key to remove associated values for.
Returns
The number of values that were associated with the key.

Definition at line 1148 of file Map.h.

◆ Remove() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
int32 TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Remove ( KeyInitType InKey,
ValueInitType InValue )
inline

Remove associations between the specified key and value from the map.

Parameters
InKeyThe key part of the pair to remove.
InValueThe value part of the pair to remove.
Returns
The number of associations removed.

Definition at line 1160 of file Map.h.

◆ RemoveSingle()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
int32 TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::RemoveSingle ( KeyInitType InKey,
ValueInitType InValue )
inline

Remove the first association between the specified key and value from the map.

Parameters
InKeyThe key part of the pair to remove.
InValueThe value part of the pair to remove.
Returns
The number of associations removed.

Definition at line 1183 of file Map.h.

Friends And Related Symbol Documentation

◆ TContainerTraits< TMultiMap >

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
friend struct TContainerTraits< TMultiMap >
friend

Definition at line 986 of file Map.h.


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