TMultiMap

A [TMapBase](API\Runtime\Core\Containers\TMapBase) specialization that allows multiple values to be associated with each key.

Windows
MacOS
Linux

Inheritance Hierarchy

Syntax

template<typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
class TMultiMap : public TSortableMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >

Remarks

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

Constructors

Name Description

Public function

TMultiMap()

Public function

TMultiMap

(
    TMultiMap&&
)

Public function

TMultiMap

(
    const TMultiMap&
)

Public function

TMultiMap

(
    TMultiMap< KeyType, ValueType, Othe...
)

Constructor for moving elements from a TMap with a different SetAllocator

Public function

TMultiMap

(
    const TMultiMap< KeyType, ValueType...
)

Constructor for copying elements from a TMap with a different SetAllocator

Public function

TMultiMap

(
    std::initializer_list< TPairInitial...
)

Constructor which gets its elements from a native initializer list

Functions

Name Description

Public function

ValueType &

 

AddUnique

(
    const KeyType& InKey,
    const ValueType& InValue
)

Add a key-value association to the map.

Public function

ValueType &

 

AddUnique

(
    const KeyType& InKey,
    ValueType&& InValue
)

Public function

ValueType &

 

AddUnique

(
    KeyType&& InKey,
    const ValueType& InValue
)

Public function

ValueType &

 

AddUnique

(
    KeyType&& InKey,
    ValueType&& InValue
)

Public function

void

 

Append

(
    TMultiMap< KeyType, ValueType, Othe...
)

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.

Public function

void

 

Append

(
    const TMultiMap< KeyType, ValueType...
)

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

Public function

ValueType &

 

EmplaceUnique

(
    InitKeyType&& InKey,
    InitValueType&& InValue
)

Add a key-value association to the map.

Public function Const

const ValueT...

 

FindPair

(
    KeyInitType Key,
    ValueInitType Value
)

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

Public function

ValueType &#...

 

FindPair

(
    KeyInitType Key,
    ValueInitType Value
)

Find an association between a specified key and value.

Public function Const

void

 

MultiFind

(
    KeyInitType Key,
    TArray< ValueType, Allocator >& Ou...,
    bool bMaintainOrder
)

Finds all values associated with the specified key.

Public function Const

void

 

MultiFindPointer

(
    KeyInitType Key,
    TArray< const ValueType*, Allo...,
    bool bMaintainOrder
)

Finds all values associated with the specified key.

Public function

void

 

MultiFindPointer

(
    KeyInitType Key,
    TArray< ValueType*, Allocator ...,
    bool bMaintainOrder
)

Public function Const

int32

 

Num

(
    KeyInitType Key
)

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

Public function Const

int32

 

Num()

Since we implement an overloaded Num() function in TMultiMap, we need to reimplement TMapBase::Num to make it visible.

Public function

int32

 

Remove

(
    KeyConstPointerType InKey
)

Remove all value associations for a key.

Public function

int32

 

Remove

(
    KeyInitType InKey,
    ValueInitType InValue
)

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

Public function

int32

 

RemoveSingle

(
    KeyInitType InKey,
    ValueInitType InValue
)

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

Operators

Name Description

Public function

TMultiMap &

 

operator=

(
    TMultiMap&&
)

Public function

TMultiMap &

 

operator=

(
    const TMultiMap&
)

Public function

TMultiMap &

 

operator=

(
    TMultiMap< KeyType, ValueType, Othe...
)

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

Public function

TMultiMap &

 

operator=

(
    const TMultiMap< KeyType, ValueType...
)

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

Public function

TMultiMap &

 

operator=

(
    std::initializer_list< TPairInitial...
)

Assignment operator which gets its elements from a native initializer list

Typedefs

References

Module

Core

Header

Runtime/Core/Public/Containers/Map.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback