Ark Server API (ASA) - Wiki
|
#include <SortedMap.h>
Classes | |
struct | FKeyForward |
class | TBaseIterator |
class | TBaseReverseIterator |
class | TConstIterator |
class | TConstKeyIterator |
class | TConstReverseIterator |
class | TIterator |
class | TKeyIterator |
class | TReverseIterator |
Public Types | |
typedef TTypeTraits< KeyType >::ConstPointerType | KeyConstPointerType |
typedef TTypeTraits< KeyType >::ConstInitType | KeyInitType |
typedef TTypeTraits< ValueType >::ConstInitType | ValueInitType |
typedef TPair< KeyType, ValueType > | ElementType |
typedef ElementArrayType::RangedForIteratorType | RangedForIteratorType |
typedef ElementArrayType::RangedForConstIteratorType | RangedForConstIteratorType |
Private Types | |
typedef TArray< ElementType, ArrayAllocator > | ElementArrayType |
Private Member Functions | |
template<typename ArgType > | |
FORCEINLINE ValueType & | FindOrAddImpl (ArgType &&Key) |
FORCEINLINE int32 | FindIndex (KeyConstPointerType Key) |
template<typename InitKeyType > | |
FORCEINLINE ElementType * | AllocateMemoryForEmplace (InitKeyType &&InKey) |
Private Attributes | |
ElementArrayType | Pairs |
Friends | |
template<typename OtherKeyType , typename OtherValueType , typename OtherArrayAllocator , typename OtherSortPredicate > | |
class | TSortedMap |
struct | TSortedMapPrivateFriend |
A Map of keys to value, implemented as a sorted TArray of TPairs.
It has a mostly identical interface to TMap and is designed as a drop in replacement. Keys must be unique, there is no equivalent sorted version of TMultiMap. It uses half as much memory as TMap, but adding and removing elements is O(n), and finding is O(Log n). In practice it is faster than TMap for low element counts, and slower as n increases, This map is always kept sorted by the key type so cannot be sorted manually.
Definition at line 19 of file SortedMap.h.
|
private |
Definition at line 460 of file SortedMap.h.
typedef TPair<KeyType, ValueType> TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate >::ElementType |
Definition at line 28 of file SortedMap.h.
typedef TTypeTraits<KeyType>::ConstPointerType TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate >::KeyConstPointerType |
Definition at line 25 of file SortedMap.h.
typedef TTypeTraits<KeyType>::ConstInitType TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate >::KeyInitType |
Definition at line 26 of file SortedMap.h.
typedef ElementArrayType::RangedForConstIteratorType TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate >::RangedForConstIteratorType |
Definition at line 757 of file SortedMap.h.
typedef ElementArrayType::RangedForIteratorType TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate >::RangedForIteratorType |
Ranged For iterators. Unlike normal TMap these are not the same as the normal iterator for performance reasons
Definition at line 756 of file SortedMap.h.
typedef TTypeTraits<ValueType>::ConstInitType TSortedMap< KeyType, ValueType, ArrayAllocator, SortPredicate >::ValueInitType |
Definition at line 27 of file SortedMap.h.
|
default |
|
default |
|
default |
|
inline |
Constructor for moving elements from a TSortedMap with a different ArrayAllocator.
Definition at line 38 of file SortedMap.h.
|
inline |
Constructor for copying elements from a TSortedMap with a different ArrayAllocator.
Definition at line 45 of file SortedMap.h.
|
inline |
Constructor which gets its elements from a native initializer list
Definition at line 51 of file SortedMap.h.
|
inline |
Sets a default value associated with a key.
InKey | The key to associate the value with. |
Definition at line 179 of file SortedMap.h.
|
inline |
Sets the value associated with a key.
InKey | The key to associate the value with. |
InValue | The value to associate with the key. |
Definition at line 168 of file SortedMap.h.
|
inline |
Definition at line 169 of file SortedMap.h.
|
inline |
Definition at line 180 of file SortedMap.h.
|
inline |
Definition at line 170 of file SortedMap.h.
|
inline |
Definition at line 171 of file SortedMap.h.
|
inlineprivate |
Allocates raw memory for emplacing
Definition at line 482 of file SortedMap.h.
|
inline |
Add all items from another map to our map (if any keys are in both, the value from the other map wins).
OtherMap | The other map of items to add. |
Definition at line 447 of file SortedMap.h.
|
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.
OtherMap | The other map of items to move the elements from. |
Definition at line 430 of file SortedMap.h.
|
inline |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
Definition at line 764 of file SortedMap.h.
|
inline |
Definition at line 765 of file SortedMap.h.
|
inline |
Checks if map contains the specified key.
Key | The key to check for. |
Definition at line 328 of file SortedMap.h.
|
inline |
Tracks the container's memory use through an archive.
Definition at line 156 of file SortedMap.h.
|
inline |
Creates a const iterator over all the pairs in this map
Definition at line 738 of file SortedMap.h.
|
inline |
Creates a const iterator over the values associated with a specified key in a map. This will be at most one value because keys must be unique
Definition at line 750 of file SortedMap.h.
|
inline |
Creates an iterator over all the pairs in this map
Definition at line 732 of file SortedMap.h.
|
inline |
Creates an iterator over the values associated with a specified key in a map. This will be at most one value because keys must be unique
Definition at line 744 of file SortedMap.h.
|
inline |
Describes the map's contents through an output device.
Ar | The output device to describe the map's contents through. |
Definition at line 382 of file SortedMap.h.
|
inline |
Sets a default value associated with a key.
InKey | The key to associate the value with. |
Definition at line 206 of file SortedMap.h.
|
inline |
Sets the value associated with a key.
InKey | - The key to associate the value with. |
InValue | - The value to associate with the key. |
Definition at line 190 of file SortedMap.h.
|
inline |
Removes all elements from the map, potentially leaving space allocated for an expected number of elements about to be added.
ExpectedNumElements | The number of elements about to be added to the set. |
Definition at line 104 of file SortedMap.h.
|
inline |
Definition at line 766 of file SortedMap.h.
|
inline |
Definition at line 767 of file SortedMap.h.
|
inline |
Returns the value associated with a specified key.
Key | The key to search for. |
Definition at line 259 of file SortedMap.h.
|
inline |
Definition at line 271 of file SortedMap.h.
|
inline |
Finds a pair with the specified key, removes it from the map, and returns the value part of the pair. If no pair was found, an exception is thrown.
Key | The key to search for |
Definition at line 414 of file SortedMap.h.
|
inline |
Returns a reference to the value associated with a specified key.
Key | The key to search for. |
Definition at line 292 of file SortedMap.h.
|
inline |
Definition at line 299 of file SortedMap.h.
|
inlineprivate |
Find index of key
Definition at line 475 of file SortedMap.h.
|
inline |
Returns the key associated with the specified value. The time taken is O(N) in the number of pairs.
Value | The value to search for. |
Definition at line 241 of file SortedMap.h.
|
inline |
Returns the value associated with a specified key, or if none exists, adds a value using the default constructor.
Key | The key to search for. |
Definition at line 283 of file SortedMap.h.
|
inline |
Definition at line 284 of file SortedMap.h.
|
inlineprivate |
Implementation of find and add
Definition at line 464 of file SortedMap.h.
|
inline |
Returns the value associated with a specified key.
Key | The key to search for. |
Definition at line 312 of file SortedMap.h.
|
inline |
Generates an array from the keys in this map.
Definition at line 356 of file SortedMap.h.
|
inline |
Generates an array from the values in this map.
Definition at line 368 of file SortedMap.h.
|
inline |
Helper function to return the amount of memory allocated by this container. Only returns the size of allocations made directly by the container, not the elements themselves.
Definition at line 150 of file SortedMap.h.
|
inline |
Returns the unique keys contained within this map.
OutKeys | Upon return, contains the set of unique keys in this map. |
Definition at line 343 of file SortedMap.h.
|
inline |
Returns true if the map is empty and contains no elements.
Definition at line 133 of file SortedMap.h.
|
inline |
Definition at line 139 of file SortedMap.h.
|
inline |
Inequality operator. This is efficient because pairs are always sorted.
Definition at line 94 of file SortedMap.h.
|
default |
|
inline |
Assignment operator for copying elements from a TSortedMap with a different ArrayAllocator.
Definition at line 70 of file SortedMap.h.
|
inline |
Assignment operator which gets its elements from a native initializer list
Definition at line 77 of file SortedMap.h.
|
default |
|
inline |
Assignment operator for moving elements from a TSortedMap with a different ArrayAllocator.
Definition at line 62 of file SortedMap.h.
|
inline |
Equality operator. This is efficient because pairs are always sorted.
Definition at line 88 of file SortedMap.h.
|
inline |
Definition at line 456 of file SortedMap.h.
|
inline |
Definition at line 457 of file SortedMap.h.
|
inline |
Removes all value associations for a key.
InKey | The key to remove associated values for. |
Definition at line 221 of file SortedMap.h.
|
inline |
Removes the pair with the specified key and copies the value that was removed to the ref parameter.
Key | The key to search for |
OutRemovedValue | If found, the value that was removed (not modified if the key was not found) |
Definition at line 394 of file SortedMap.h.
|
inline |
Preallocates enough memory to contain Number elements.
Definition at line 122 of file SortedMap.h.
|
inline |
Efficiently empties out the map but preserves all allocations and capacities.
Definition at line 110 of file SortedMap.h.
|
inline |
Shrinks the pair set to avoid slack.
Definition at line 116 of file SortedMap.h.
|
friend |
Definition at line 22 of file SortedMap.h.
|
friend |
Definition at line 769 of file SortedMap.h.
|
private |
An array of the key-value pairs in the map
Definition at line 607 of file SortedMap.h.