Language:
Discover
By Skill Level
By Category

TMapBase

Choose your OS:

Inheritance Hierarchy

Syntax

template<typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
class TMapBase

Remarks

The base class of maps from keys to values. Implemented using a TSet of key-value pairs with a custom KeyFuncs, with the same O(1) addition, removal, and finding.

Variables

Name Description

Protected variable

ElementSetType

 

Pairs

A set of the key-value pairs in the map.

Constructors

Name Description

Protected function

TMapBase()

Protected function

TMapBase

(
    TMapBase &&
)

Protected function

TMapBase

(
    const TMapBase &
)

Protected function

TMapBase

(
    TMapBase < KeyType, ValueType, Other...
)

Constructor for moving elements from a TMap with a different SetAllocator

Protected function

TMapBase

(
    const TMapBase < KeyType, ValueType,...
)

Constructor for copying elements from a TMap with a different SetAllocator

Functions

Name Description

Public function

ValueType &

 

Add

(
    const KeyType& InKey
)

Set a default value associated with a key.

Public function

ValueType &

 

Add

(
    KeyType&& InKey,
    ValueType&& InValue
)

Public function

ValueType &

 

Add

(
    KeyType&& InKey,
    const ValueType& InValue
)

Public function

ValueType &

 

Add

(
    const KeyType& InKey,
    ValueType&& InValue
)

Public function

ValueType &

 

Add

(
    const KeyType& InKey,
    const ValueType& InValue
)

Set the value associated with a key.

Public function

ValueType &

 

Add

(
    KeyType&& InKey
)

Public function

void

 

Compact()

Compacts the pair set to remove holes

Public function

void

 

CompactStable()

Compacts the pair set to remove holes. Does not change the iteration order of the elements.

Public function

bool

 

Contains

(
    KeyConstPointerType Key
)

Check if map contains the specified key.

true if the map contains the key.

Public function

void

 

CountBytes

(
    FArchive & Ar
)

Track the container's memory use through an archive.

Public function

TConstIterat ...

 

CreateConstIterator()

Creates a const iterator over all the pairs in this map

Public function

TConstKeyIte ...

 

CreateConstKeyIterator

(
    KeyInitType InKey
)

Creates a const iterator over the values associated with a specified key in a map

Public function

TIterator

 

CreateIterator()

Creates an iterator over all the pairs in this map

Public function

TKeyIterator

 

CreateKeyIterator

(
    KeyInitType InKey
)

Creates an iterator over the values associated with a specified key in a map

Public function

void

 

Dump

(
    FOutputDevice & Ar
)

Describes the map's contents through an output device.

Public function

ValueType &

 

Emplace

(
    InitKeyType&& InKey,
    InitValueType&& InValue
)

Sets the value associated with a key.

Public function

ValueType &

 

Emplace

(
    InitKeyType&& InKey
)

Set a default value associated with a key.

Public function

void

 

Empty

(
    int32 ExpectedNumElements
)

Removes all elements from the map.

Public function

const ValueT...

 

Find

(
    KeyConstPointerType Key
)

Public function

ValueType &#...

 

Find

(
    KeyConstPointerType Key
)

Find the value associated with a specified key.

Public function

ValueType &

 

FindChecked

(
    KeyConstPointerType Key
)

Find a reference to the value associated with a specified key.

Public function

const ValueT...

 

FindChecked

(
    KeyConstPointerType Key
)

Find the value associated with a specified key, or if none exists, adds a value using the key as the constructor parameter.

Public function

const KeyTyp...

 

FindKey

(
    ValueInitType Value
)

Find the key associated with the specified value.

Public function

ValueType &

 

FindOrAdd

(
    KeyType&& Key
)

Public function

ValueType &

 

FindOrAdd

(
    const KeyType& Key
)

Find the value associated with a specified key, or if none exists, adds a value using the default constructor.

Public function

ValueType

 

FindRef

(
    KeyConstPointerType Key
)

Find the value associated with a specified key.

Public function

void

 

GenerateKeyArray

(
    TArray < KeyType, Allocator >& OutA...
)

Generate an array from the keys in this map.

Public function

void

 

GenerateValueArray

(
    TArray < ValueType, Allocator >& Ou...
)

Generate an array from the values in this map.

Public function

uint32

 

GetAllocatedSize()

Helper function to return the amount of memory allocated by this container .

Public function

int32

 

GetKeys

(
    TArray < KeyType, Allocator >& OutK...
)

Get the unique keys contained within this map.

The number of unique keys in the map.

Public function

int32

 

Num()

The number of elements in the map.

Public function

bool

 

OrderIndependentCompareEqual

(
    const TMapBase & Other
)

Compare this map with another for equality.

Public function

int32

 

Remove

(
    KeyConstPointerType InKey
)

Remove all value associations for a key.

The number of values that were associated with the key.

Public function

void

 

Reserve

(
    int32 Number
)

Preallocates enough memory to contain Number elements

Public function

void

 

Reset()

Efficiently empties out the map but preserves all allocations and capacities

Public function

void

 

Shrink()

Shrinks the pair set to avoid slack.

Operators

Name Description

Protected function

TMapBase &

 

operator=

(
    TMapBase &&
)

Protected function

TMapBase &

 

operator=

(
    const TMapBase &
)

Protected function

TMapBase &

 

operator=

(
    TMapBase < KeyType, ValueType, Other...
)

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

Protected function

TMapBase &

 

operator=

(
    const TMapBase < KeyType, ValueType,...
)

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

Classes

Name

Description

Protected class

TBaseIterator

The base of TMapBase iterators.

Protected class

TBaseKeyIterator

The base type of iterators that iterate over the values associated with a specified key.

Public class

TConstIterator

Const map iterator.

Public class

TConstKeyIterator

Iterates over values associated with a specified key in a const map.

Public class

TIterator

Map iterator.

Public class

TKeyIterator

Iterates over values associated with a specified key in a map.

Typedefs

References

Module

Core

Header

Runtime/Core/Public/Containers/Map.h