#include <wpi/DenseMap.h>
Public Types | |
using | size_type = unsigned |
using | key_type = KeyT |
using | mapped_type = ValueT |
using | value_type = BucketT |
using | iterator = DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT> |
using | const_iterator |
Public Member Functions | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
bool | empty () const |
unsigned | size () const |
void | reserve (size_type NumEntries) |
Grow the densemap so that it can contain at least NumEntries items before resizing again. | |
void | clear () |
bool | contains (const_arg_type_t< KeyT > Val) const |
Return true if the specified key is in the map, false otherwise. | |
size_type | count (const_arg_type_t< KeyT > Val) const |
Return 1 if the specified key is in the map, 0 otherwise. | |
iterator | find (const_arg_type_t< KeyT > Val) |
const_iterator | find (const_arg_type_t< KeyT > Val) const |
template<class LookupKeyT > | |
iterator | find_as (const LookupKeyT &Val) |
Alternate version of find() which allows a different, and possibly less expensive, key type. | |
template<class LookupKeyT > | |
const_iterator | find_as (const LookupKeyT &Val) const |
ValueT | lookup (const_arg_type_t< KeyT > Val) const |
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists. | |
const ValueT & | at (const_arg_type_t< KeyT > Val) const |
at - Return the entry for the specified key, or abort if no such entry exists. | |
std::pair< iterator, bool > | insert (const std::pair< KeyT, ValueT > &KV) |
std::pair< iterator, bool > | insert (std::pair< KeyT, ValueT > &&KV) |
template<typename... Ts> | |
std::pair< iterator, bool > | try_emplace (KeyT &&Key, Ts &&... Args) |
template<typename... Ts> | |
std::pair< iterator, bool > | try_emplace (const KeyT &Key, Ts &&... Args) |
template<typename LookupKeyT > | |
std::pair< iterator, bool > | insert_as (std::pair< KeyT, ValueT > &&KV, const LookupKeyT &Val) |
Alternate version of insert() which allows a different, and possibly less expensive, key type. | |
template<typename InputIt > | |
void | insert (InputIt I, InputIt E) |
insert - Range insertion of pairs. | |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (const KeyT &Key, V &&Val) |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (KeyT &&Key, V &&Val) |
ValueT & | getOrInsertDefault (KeyT &&Key) |
Returns the value associated to the key in the map if it exists. | |
ValueT & | getOrInsertDefault (const KeyT &Key) |
Returns the value associated to the key in the map if it exists. | |
bool | erase (const KeyT &Val) |
void | erase (iterator I) |
value_type & | FindAndConstruct (const KeyT &Key) |
ValueT & | operator[] (const KeyT &Key) |
value_type & | FindAndConstruct (KeyT &&Key) |
ValueT & | operator[] (KeyT &&Key) |
bool | isPointerIntoBucketsArray (const void *Ptr) const |
isPointerIntoBucketsArray - Return true if the specified pointer points somewhere into the DenseMap's array of buckets (i.e. | |
const void * | getPointerIntoBucketsArray () const |
getPointerIntoBucketsArray() - Return an opaque pointer into the buckets array. | |
size_t | getMemorySize () const |
Return the approximate size (in bytes) of the actual map. | |
![]() | |
DebugEpochBase ()=default | |
void | incrementEpoch () |
Calling incrementEpoch invalidates all handles pointing into the calling instance. | |
~DebugEpochBase () | |
The destructor calls incrementEpoch to make use-after-free bugs more likely to crash deterministically. | |
Protected Member Functions | |
DenseMapBase ()=default | |
void | destroyAll () |
void | initEmpty () |
unsigned | getMinBucketToReserveForEntries (unsigned NumEntries) |
Returns the number of buckets to allocate to ensure that the DenseMap can accommodate NumEntries without need to grow(). | |
void | moveFromOldBuckets (BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) |
template<typename OtherBaseT > | |
void | copyFrom (const DenseMapBase< OtherBaseT, KeyT, ValueT, KeyInfoT, BucketT > &other) |
Static Protected Member Functions | |
static unsigned | getHashValue (const KeyT &Val) |
template<typename LookupKeyT > | |
static unsigned | getHashValue (const LookupKeyT &Val) |
static const KeyT | getEmptyKey () |
static const KeyT | getTombstoneKey () |
using wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::const_iterator |
using wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::iterator = DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT> |
using wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::key_type = KeyT |
using wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::mapped_type = ValueT |
using wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size_type = unsigned |
using wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::value_type = BucketT |
|
protecteddefault |
|
inline |
at - Return the entry for the specified key, or abort if no such entry exists.
|
inline |
|
inline |
|
inline |
|
inline |
Return true if the specified key is in the map, false otherwise.
|
inlineprotected |
|
inline |
Return 1 if the specified key is in the map, 0 otherwise.
|
inlineprotected |
|
inlinenodiscard |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Alternate version of find() which allows a different, and possibly less expensive, key type.
The DenseMapInfo is responsible for supplying methods getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key type used.
|
inline |
|
inline |
|
inline |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inline |
Return the approximate size (in bytes) of the actual map.
This is just the raw memory used by DenseMap. If entries are pointers to objects, the size of the referenced objects are not included.
|
inlineprotected |
Returns the number of buckets to allocate to ensure that the DenseMap can accommodate NumEntries
without need to grow().
|
inline |
Returns the value associated to the key in the map if it exists.
If it does not exist, emplace a default value for the key and returns a reference to the newly created value.
|
inline |
Returns the value associated to the key in the map if it exists.
If it does not exist, emplace a default value for the key and returns a reference to the newly created value.
|
inline |
getPointerIntoBucketsArray() - Return an opaque pointer into the buckets array.
In conjunction with the previous method, this can be used to determine whether an insertion caused the DenseMap to reallocate.
|
inlinestaticprotected |
|
inlineprotected |
|
inline |
|
inline |
insert - Range insertion of pairs.
|
inline |
|
inline |
Alternate version of insert() which allows a different, and possibly less expensive, key type.
The DenseMapInfo is responsible for supplying methods getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key type used.
|
inline |
|
inline |
|
inline |
|
inline |
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists.
|
inlineprotected |
|
inline |
|
inline |
|
inline |
Grow the densemap so that it can contain at least NumEntries
items before resizing again.
|
inline |
|
inline |
|
inline |