WPILibC++ 2024.3.2
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT > Class Template Reference

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/DenseMap.h>

Inheritance diagram for wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >:
wpi::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > > wpi::DebugEpochBase

Public Member Functions

 DenseMap (unsigned InitialReserve=0)
 Create a DenseMap with an optional InitialReserve that guarantee that this number of elements can be inserted in the map without grow() More...
 
 DenseMap (const DenseMap &other)
 
 DenseMap (DenseMap &&other)
 
template<typename InputIt >
 DenseMap (const InputIt &I, const InputIt &E)
 
 DenseMap (std::initializer_list< typename BaseT::value_type > Vals)
 
 ~DenseMap ()
 
void swap (DenseMap &RHS)
 
DenseMapoperator= (const DenseMap &other)
 
DenseMapoperator= (DenseMap &&other)
 
void copyFrom (const DenseMap &other)
 
void init (unsigned InitNumEntries)
 
void grow (unsigned AtLeast)
 
void shrink_and_clear ()
 
- Public Member Functions inherited from wpi::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
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. More...
 
void clear ()
 
bool contains (const_arg_type_t< KeyT > Val) const
 Return true if the specified key is in the map, false otherwise. More...
 
size_type count (const_arg_type_t< KeyT > Val) const
 Return 1 if the specified key is in the map, 0 otherwise. More...
 
iterator find (const_arg_type_t< KeyT > Val)
 
const_iterator find (const_arg_type_t< KeyT > Val) const
 
iterator find_as (const LookupKeyT &Val)
 Alternate version of find() which allows a different, and possibly less expensive, key type. More...
 
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. More...
 
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. More...
 
std::pair< iterator, bool > insert (const std::pair< KeyT, ValueT > &KV)
 
std::pair< iterator, bool > insert (std::pair< KeyT, ValueT > &&KV)
 
void insert (InputIt I, InputIt E)
 insert - Range insertion of pairs. More...
 
std::pair< iterator, bool > try_emplace (KeyT &&Key, Ts &&... Args)
 
std::pair< iterator, bool > try_emplace (const KeyT &Key, Ts &&... Args)
 
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. More...
 
ValueT & getOrInsertDefault (KeyT &&Key)
 Returns the value associated to the key in the map if it exists. More...
 
ValueT & getOrInsertDefault (const KeyT &Key)
 Returns the value associated to the key in the map if it exists. More...
 
bool erase (const KeyT &Val)
 
void erase (iterator I)
 
value_typeFindAndConstruct (const KeyT &Key)
 
value_typeFindAndConstruct (KeyT &&Key)
 
ValueT & operator[] (const 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. More...
 
const void * getPointerIntoBucketsArray () const
 getPointerIntoBucketsArray() - Return an opaque pointer into the buckets array. More...
 
size_t getMemorySize () const
 Return the approximate size (in bytes) of the actual map. More...
 
- Public Member Functions inherited from wpi::DebugEpochBase
 DebugEpochBase ()=default
 
void incrementEpoch ()
 Calling incrementEpoch invalidates all handles pointing into the calling instance. More...
 
 ~DebugEpochBase ()
 The destructor calls incrementEpoch to make use-after-free bugs more likely to crash deterministically. More...
 

Friends

class DenseMapBase< DenseMap, KeyT, ValueT, KeyInfoT, BucketT >
 

Additional Inherited Members

- Public Types inherited from wpi::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >
using size_type = unsigned
 
using key_type = KeyT
 
using mapped_type = ValueT
 
using value_type = wpi::detail::DenseMapPair< KeyT, ValueT >
 
using iterator = DenseMapIterator< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >
 
using const_iterator = DenseMapIterator< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT >, true >
 
- Protected Member Functions inherited from wpi::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >
 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(). More...
 
void moveFromOldBuckets (wpi::detail::DenseMapPair< KeyT, ValueT > *OldBucketsBegin, wpi::detail::DenseMapPair< KeyT, ValueT > *OldBucketsEnd)
 
void copyFrom (const DenseMapBase< OtherBaseT, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > > &other)
 
- Static Protected Member Functions inherited from wpi::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >
static unsigned getHashValue (const KeyT &Val)
 
static unsigned getHashValue (const LookupKeyT &Val)
 
static const KeyT getEmptyKey ()
 
static const KeyT getTombstoneKey ()
 

Constructor & Destructor Documentation

◆ DenseMap() [1/5]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( unsigned  InitialReserve = 0)
inlineexplicit

Create a DenseMap with an optional InitialReserve that guarantee that this number of elements can be inserted in the map without grow()

◆ DenseMap() [2/5]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( const DenseMap< KeyT, ValueT, KeyInfoT, BucketT > &  other)
inline

◆ DenseMap() [3/5]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( DenseMap< KeyT, ValueT, KeyInfoT, BucketT > &&  other)
inline

◆ DenseMap() [4/5]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
template<typename InputIt >
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( const InputIt &  I,
const InputIt &  E 
)
inline

◆ DenseMap() [5/5]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::DenseMap ( std::initializer_list< typename BaseT::value_type Vals)
inline

◆ ~DenseMap()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::~DenseMap ( )
inline

Member Function Documentation

◆ copyFrom()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
void wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::copyFrom ( const DenseMap< KeyT, ValueT, KeyInfoT, BucketT > &  other)
inline

◆ grow()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
void wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::grow ( unsigned  AtLeast)
inline

◆ init()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
void wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::init ( unsigned  InitNumEntries)
inline

◆ operator=() [1/2]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
DenseMap & wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::operator= ( const DenseMap< KeyT, ValueT, KeyInfoT, BucketT > &  other)
inline

◆ operator=() [2/2]

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
DenseMap & wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::operator= ( DenseMap< KeyT, ValueT, KeyInfoT, BucketT > &&  other)
inline

◆ shrink_and_clear()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
void wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::shrink_and_clear ( )
inline

◆ swap()

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
void wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >::swap ( DenseMap< KeyT, ValueT, KeyInfoT, BucketT > &  RHS)
inline

Friends And Related Function Documentation

◆ DenseMapBase< DenseMap, KeyT, ValueT, KeyInfoT, BucketT >

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = wpi::detail::DenseMapPair<KeyT, ValueT>>
friend class DenseMapBase< DenseMap, KeyT, ValueT, KeyInfoT, BucketT >
friend

The documentation for this class was generated from the following file: