engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs > 模板类 参考

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

#include <Map.h>

+ 类 TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs > 继承关系图:

Public 成员函数

FORCEINLINE ValueType & AddUnique (const KeyType &InKey, const ValueType &InValue)
 Add a key-value association to the map. 更多...
 
template<typename OtherSetAllocator >
void Append (const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &OtherMultiMap)
 Add all items from another map to our map (if any keys are in both, the value from the other map wins). 更多...
 
template<typename OtherSetAllocator >
void Append (TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&OtherMultiMap)
 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. 更多...
 
template<typename InitKeyType , typename InitValueType >
ValueType & EmplaceUnique (InitKeyType &&InKey, InitValueType &&InValue)
 Add a key-value association to the map. 更多...
 
ValueType * FindPair (KeyInitType Key, ValueInitType Value)
 Find an association between a specified key and value. 更多...
 
FORCEINLINE const ValueType * FindPair (KeyInitType Key, ValueInitType Value) const
 Find an association between a specified key and value. 更多...
 
template<typename Allocator >
void MultiFind (KeyInitType Key, TArray< ValueType, Allocator > &OutValues, bool bMaintainOrder=false) const
 Finds all values associated with the specified key. 更多...
 
template<typename Allocator >
void MultiFindPointer (KeyInitType Key, TArray< const ValueType *, Allocator > &OutValues, bool bMaintainOrder=false) const
 Finds all values associated with the specified key. 更多...
 
int32 Num (KeyInitType Key) const
 Returns the number of values within this map associated with the specified key
 
template<typename OtherSetAllocator >
TMultiMap & operator= (const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 Assignment operator for copying elements from a TMap with a different SetAllocator
 
TMultiMap & operator= (std::initializer_list< TPairInitializer< const KeyType &, const ValueType & > > InitList)
 Assignment operator which gets its elements from a native initializer list
 
template<typename OtherSetAllocator >
TMultiMap & operator= (TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 Assignment operator for moving elements from a TMap with a different SetAllocator
 
FORCEINLINE int32 Remove (KeyConstPointerType InKey)
 Remove all value associations for a key. 更多...
 
int32 Remove (KeyInitType InKey, ValueInitType InValue)
 Remove associations between the specified key and value from the map. 更多...
 
int32 RemoveSingle (KeyInitType InKey, ValueInitType InValue)
 Remove the first association between the specified key and value from the map. 更多...
 
template<typename OtherSetAllocator >
 TMultiMap (const TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 Constructor for copying elements from a TMap with a different SetAllocator
 
 TMultiMap (std::initializer_list< TPairInitializer< const KeyType &, const ValueType & > > InitList)
 Constructor which gets its elements from a native initializer list
 
template<typename OtherSetAllocator >
 TMultiMap (TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 Constructor for moving elements from a TMap with a different SetAllocator
 
- Public 成员函数 继承自 TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
template<typename PREDICATE_CLASS >
FORCEINLINE void KeySort (const PREDICATE_CLASS &Predicate)
 Sorts the pairs array using each pair's Key as the sort criteria, then rebuilds the map's hash. 更多...
 
template<typename PREDICATE_CLASS >
FORCEINLINE void KeyStableSort (const PREDICATE_CLASS &Predicate)
 Stable sorts the pairs array using each pair's Key as the sort criteria, then rebuilds the map's hash. 更多...
 
template<typename PREDICATE_CLASS >
FORCEINLINE void ValueSort (const PREDICATE_CLASS &Predicate)
 Sorts the pairs array using each pair's Value as the sort criteria, then rebuilds the map's hash. 更多...
 
template<typename PREDICATE_CLASS >
FORCEINLINE void ValueStableSort (const PREDICATE_CLASS &Predicate)
 Stable sorts the pairs array using each pair's Value as the sort criteria, then rebuilds the map's hash. 更多...
 
- Public 成员函数 继承自 TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
FORCEINLINE ValueType & Add (const KeyType &InKey)
 Set a default value associated with a key. 更多...
 
FORCEINLINE ValueType & Add (const KeyType &InKey, const ValueType &InValue)
 Set the value associated with a key. 更多...
 
FORCEINLINE ValueType & Add (const TTuple< KeyType, ValueType > &InKeyValue)
 Set the value associated with a key. 更多...
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey)
 See Add() and class documentation section on ByHash() functions
 
FORCEINLINE ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey, const ValueType &InValue)
 See Add() and class documentation section on ByHash() functions
 
FORCEINLINE TRangedForIterator begin ()
 DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
 
FORCEINLINE void Compact ()
 Compacts the pair set to remove holes
 
FORCEINLINE void CompactStable ()
 Compacts the pair set to remove holes. 更多...
 
FORCEINLINE bool Contains (KeyConstPointerType Key) const
 Check if map contains the specified key. 更多...
 
template<typename ComparableKey >
FORCEINLINE bool ContainsByHash (uint32 KeyHash, const ComparableKey &Key) const
 See Contains() and class documentation section on ByHash() functions
 
FORCEINLINE void CountBytes (FArchive &Ar) const
 Track the container's memory use through an archive. 更多...
 
FORCEINLINE TConstIterator CreateConstIterator () const
 Creates a const iterator over all the pairs in this map
 
FORCEINLINE TConstKeyIterator CreateConstKeyIterator (KeyInitType InKey) const
 Creates a const iterator over the values associated with a specified key in a map
 
FORCEINLINE TIterator CreateIterator ()
 Creates an iterator over all the pairs in this map
 
FORCEINLINE TKeyIterator CreateKeyIterator (KeyInitType InKey)
 Creates an iterator over the values associated with a specified key in a map
 
void Dump (FOutputDevice &Ar)
 Describes the map's contents through an output device. 更多...
 
template<typename InitKeyType >
ValueType & Emplace (InitKeyType &&InKey)
 Set a default value associated with a key. 更多...
 
template<typename InitKeyType , typename InitValueType >
ValueType & Emplace (InitKeyType &&InKey, InitValueType &&InValue)
 Sets the value associated with a key. 更多...
 
template<typename InitKeyType >
ValueType & EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey)
 See Emplace() and class documentation section on ByHash() functions
 
template<typename InitKeyType , typename InitValueType >
ValueType & EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey, InitValueType &&InValue)
 See Emplace() and class documentation section on ByHash() functions
 
FORCEINLINE void Empty (int32 ExpectedNumElements=0)
 Removes all elements from the map. 更多...
 
FORCEINLINE ValueType * Find (KeyConstPointerType Key)
 Find the value associated with a specified key. 更多...
 
template<typename ComparableKey >
FORCEINLINE ValueType * FindByHash (uint32 KeyHash, const ComparableKey &Key)
 See Find() and class documentation section on ByHash() functions
 
FORCEINLINE ValueType & FindChecked (KeyConstPointerType Key)
 Find a reference to the value associated with a specified key. 更多...
 
FORCEINLINE const ValueType & FindChecked (KeyConstPointerType Key) const
 Find a reference to the value associated with a specified key. 更多...
 
const KeyType * FindKey (ValueInitType Value) const
 Find the key associated with the specified value. 更多...
 
FORCEINLINE ValueType & FindOrAdd (const KeyType &Key)
 Find the value associated with a specified key, or if none exists, adds a value using the default constructor. 更多...
 
FORCEINLINE ValueType & FindOrAdd (const KeyType &Key, const ValueType &Value)
 Find the value associated with a specified key, or if none exists, adds a value using the default constructor. 更多...
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key)
 See FindOrAdd() and class documentation section on ByHash() functions
 
FORCEINLINE ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key, const ValueType &Value)
 See FindOrAdd() and class documentation section on ByHash() functions
 
FORCEINLINE ValueType FindRef (KeyConstPointerType Key) const
 Find the value associated with a specified key. 更多...
 
template<typename Allocator >
void GenerateKeyArray (TArray< KeyType, Allocator > &OutArray) const
 Generate an array from the keys in this map. 更多...
 
template<typename Allocator >
void GenerateValueArray (TArray< ValueType, Allocator > &OutArray) const
 Generate an array from the values in this map. 更多...
 
FORCEINLINE uint32 GetAllocatedSize () const
 Helper function to return the amount of memory allocated by this container . 更多...
 
template<typename Allocator >
int32 GetKeys (TArray< KeyType, Allocator > &OutKeys) const
 Get the unique keys contained within this map. 更多...
 
template<typename Allocator >
int32 GetKeys (TSet< KeyType, Allocator > &OutKeys) const
 Get the unique keys contained within this map. 更多...
 
FORCEINLINE int32 Num () const
 
bool OrderIndependentCompareEqual (const TMapBase &Other) const
 Compare this map with another for equality. 更多...
 
FORCEINLINE int32 Remove (KeyConstPointerType InKey)
 Remove all value associations for a key. 更多...
 
template<typename ComparableKey >
FORCEINLINE int32 RemoveByHash (uint32 KeyHash, const ComparableKey &Key)
 See Remove() and class documentation section on ByHash() functions
 
FORCEINLINE void Reserve (int32 Number)
 Preallocates enough memory to contain Number elements
 
FORCEINLINE void Reset ()
 Efficiently empties out the map but preserves all allocations and capacities
 
FORCEINLINE void Shrink ()
 Shrinks the pair set to avoid slack.
 

额外继承的成员函数

- Protected 成员函数 继承自 TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
template<typename OtherSetAllocator >
TSortableMapBase & operator= (const TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 Assignment operator for copying elements from a TMap with a different SetAllocator
 
template<typename OtherSetAllocator >
TSortableMapBase & operator= (TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 Assignment operator for moving elements from a TMap with a different SetAllocator
 
template<typename OtherSetAllocator >
 TSortableMapBase (const TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 Constructor for copying elements from a TMap with a different SetAllocator
 
template<typename OtherSetAllocator >
 TSortableMapBase (TSortableMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 Constructor for moving elements from a TMap with a different SetAllocator
 
- Protected 成员函数 继承自 TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
template<typename OtherSetAllocator >
TMapBase & operator= (const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 Assignment operator for copying elements from a TMap with a different SetAllocator
 
template<typename OtherSetAllocator >
TMapBase & operator= (TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 Assignment operator for moving elements from a TMap with a different SetAllocator
 
template<typename OtherSetAllocator >
 TMapBase (const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 Constructor for copying elements from a TMap with a different SetAllocator
 
template<typename OtherSetAllocator >
 TMapBase (TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 Constructor for moving elements from a TMap with a different SetAllocator
 
- Protected 属性 继承自 TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
ElementSetType Pairs
 A set of the key-value pairs in the map.
 

详细描述

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.

成员函数说明

◆ AddUnique()

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.

参数
InKeyThe key to associate.
InValueThe value to associate.
返回
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.

◆ Append() [1/2]

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

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

参数
OtherMultiMapThe other map of items to add.

◆ Append() [2/2]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
void TMultiMap< KeyType, ValueType, SetAllocator, KeyFuncs >::Append ( TMultiMap< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&  OtherMultiMap)
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.

参数
OtherMultiMapThe other map of items to move the elements from.

◆ 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.

参数
InKeyThe key to associate.
InValueThe value to associate.
返回
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.

◆ 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.

参数
KeyThe key to find.
ValueThe value to find.
返回
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.

◆ 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)

参数
KeyThe key to find.
ValueThe value to find.
返回
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.

◆ 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.

参数
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.

◆ MultiFindPointer()

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.

参数
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.

◆ 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.

参数
InKeyThe key to remove associated values for.
返回
The number of values that were associated with the key.

◆ 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.

参数
InKeyThe key part of the pair to remove.
InValueThe value part of the pair to remove.
返回
The number of associations removed.

◆ 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.

参数
InKeyThe key part of the pair to remove.
InValueThe value part of the pair to remove.
返回
The number of associations removed.

该类的文档由以下文件生成: