|
| TMapBase ()=default |
|
| TMapBase (TMapBase &&)=default |
|
| TMapBase (const TMapBase &)=default |
|
TMapBase & | operator= (TMapBase &&)=default |
|
TMapBase & | operator= (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 > |
TMapBase & | operator= (TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other) |
|
template<typename OtherSetAllocator > |
TMapBase & | operator= (const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other) |
|
template<typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
class TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
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.
Definition at line 103 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::TMapBase |
( |
TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && | Other | ) |
|
|
inlineprotected |
Constructor for moving elements from a TMap with a different SetAllocator
Definition at line 138 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::TMapBase |
( |
const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & | Other | ) |
|
|
inlineprotected |
Constructor for copying elements from a TMap with a different SetAllocator
Definition at line 144 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::Add |
( |
const KeyType & | InKey | ) |
|
|
inline |
Set a default value associated with a key.
- Parameters
-
InKey | The key to associate the value with. |
- 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 307 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::Add |
( |
const KeyType & | InKey, |
|
|
const ValueType & | InValue ) |
|
inline |
Set the value associated with a key.
- Parameters
-
InKey | The key to associate the value with. |
InValue | The value to associate with the key. |
- 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 296 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE void TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::CompactStable |
( |
| ) |
|
|
inline |
Compacts the pair set to remove holes. Does not change the iteration order of the elements.
Definition at line 241 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename InitKeyType >
ValueType & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::Emplace |
( |
InitKeyType && | InKey | ) |
|
|
inline |
Set a default value associated with a key.
- Parameters
-
InKey | The key to associate the value with. |
- 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 331 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename InitKeyType , typename InitValueType >
ValueType & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::Emplace |
( |
InitKeyType && | InKey, |
|
|
InitValueType && | InValue ) |
|
inline |
Sets the value associated with a key.
- Parameters
-
InKey | The key to associate the value with. |
InValue | The value to associate with the key. |
- 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 317 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE void TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::Empty |
( |
int32 | ExpectedNumElements = 0 | ) |
|
|
inline |
Removes all elements from the map.
This method potentially leaves space allocated for an expected number of elements about to be added.
- Parameters
-
ExpectedNumElements | The number of elements about to be added to the set. |
Definition at line 217 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
Find the value associated with a specified key, or if none exists, adds a value using the key as the constructor parameter.
- Parameters
-
Key | The key to search for. |
- Returns
- A reference to the value associated with the specified key. Find a reference to the value associated with a specified key.
- Parameters
-
Key | The key to search for. |
- Returns
- The value associated with the specified key, or triggers an assertion if the key does not exist.
Definition at line 450 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
const KeyType * TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::FindKey |
( |
ValueInitType | Value | ) |
const |
|
inline |
Find the key associated with the specified value.
The time taken is O(N) in the number of pairs.
- Parameters
-
Value | The value to search for |
- Returns
- A pointer to the key associated with the specified value, or nullptr if the value isn't contained in this map. The pointer is only valid until the next change to any key in the map.
Definition at line 360 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
FORCEINLINE ValueType & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::FindOrAdd |
( |
const KeyType & | Key | ) |
|
|
inline |
Find the value associated with a specified key, or if none exists, adds a value using the default constructor.
- Parameters
-
Key | The key to search for. |
- Returns
- A reference to the value associated with the specified key.
Definition at line 420 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename ArgType >
FORCEINLINE ValueType & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::FindOrAddImpl |
( |
ArgType && | Arg | ) |
|
|
inlineprivate |
Find the value associated with a specified key, or if none exists, adds a value using the default constructor.
- Parameters
-
Key | The key to search for. |
- Returns
- A reference to the value associated with the specified key.
Definition at line 403 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename Allocator >
void TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::GenerateKeyArray |
( |
TArray< KeyType, Allocator > & | OutArray | ) |
const |
|
inline |
Generate an array from the keys in this map.
- Parameters
-
OutArray | Will contain the collection of keys. |
Definition at line 502 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename Allocator >
void TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::GenerateValueArray |
( |
TArray< ValueType, Allocator > & | OutArray | ) |
const |
|
inline |
Generate an array from the values in this map.
- Parameters
-
OutArray | Will contain the collection of values. |
Definition at line 516 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename Allocator >
int32 TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::GetKeys |
( |
TArray< KeyType, Allocator > & | OutKeys | ) |
const |
|
inline |
Get the unique keys contained within this map.
- Parameters
-
OutKeys | Upon return, contains the set of unique keys in this map. |
- Returns
- The number of unique keys in the map.
Definition at line 264 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMapBase & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= |
( |
const TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > & | Other | ) |
|
|
inlineprotected |
Assignment operator for copying elements from a TMap with a different SetAllocator
Definition at line 158 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherSetAllocator >
TMapBase & TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= |
( |
TMapBase< KeyType, ValueType, OtherSetAllocator, KeyFuncs > && | Other | ) |
|
|
inlineprotected |
Assignment operator for moving elements from a TMap with a different SetAllocator
Definition at line 150 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
bool TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >::OrderIndependentCompareEqual |
( |
const TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs > & | Other | ) |
const |
|
inline |
Compare this map with another for equality. Does not make any assumptions about Key order. NOTE: this might be a candidate for operator== but it was decided to make it an explicit function since it can potentially be quite slow.
- Parameters
-
Other | The other map to compare against |
- Returns
- True if both this and Other contain the same keys with values that compare ==
Definition at line 183 of file Map.h.
template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
template<typename OtherKeyType , typename OtherValueType , typename OtherSetAllocator , typename OtherKeyFuncs >