WPILibC++ 2024.3.2
wpi::StringMapImpl Class Reference

StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations. More...

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

Inheritance diagram for wpi::StringMapImpl:
wpi::StringMap< void * > wpi::StringMap< std::unique_ptr< frc::MechanismRoot2d > > wpi::StringMap< std::unique_ptr< frc::MechanismObject2d > > wpi::StringMap< T > wpi::StringMap< nt::Value > wpi::StringMap< frc::ShuffleboardLayout * > wpi::StringMap< std::chrono::nanoseconds > wpi::StringMap< MotorEntries > wpi::StringMap< NT_Entry > wpi::StringMap< std::string_view > wpi::StringMap< ProtoFile > wpi::StringMap< std::unique_ptr< google::protobuf::Message > > wpi::StringMap< size_t > wpi::StringMap< std::unique_ptr< wpi::StructDescriptor > > wpi::StringMap< EntryInfo > wpi::StringMap< ValueTy, AllocatorTy >

Public Member Functions

unsigned getNumBuckets () const
 
unsigned getNumItems () const
 
bool empty () const
 
unsigned size () const
 
void swap (StringMapImpl &Other)
 

Static Public Member Functions

static StringMapEntryBasegetTombstoneVal ()
 

Static Public Attributes

static constexpr uintptr_t TombstoneIntVal
 

Protected Member Functions

 StringMapImpl (unsigned itemSize)
 
 StringMapImpl (StringMapImpl &&RHS) noexcept
 
 StringMapImpl (unsigned InitSize, unsigned ItemSize)
 
unsigned RehashTable (unsigned BucketNo=0)
 
unsigned LookupBucketFor (std::string_view Key)
 LookupBucketFor - Look up the bucket that the specified string should end up in. More...
 
int FindKey (std::string_view Key) const
 FindKey - Look up the bucket that contains the specified key. More...
 
void RemoveKey (StringMapEntryBase *V)
 RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it. More...
 
StringMapEntryBaseRemoveKey (std::string_view Key)
 RemoveKey - Remove the StringMapEntry for the specified key from the table, returning it. More...
 
void init (unsigned Size)
 Allocate the table with the specified number of buckets and otherwise setup the map as empty. More...
 

Protected Attributes

StringMapEntryBase ** TheTable = nullptr
 
unsigned NumBuckets = 0
 
unsigned NumItems = 0
 
unsigned NumTombstones = 0
 
unsigned ItemSize
 

Detailed Description

StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations.

Constructor & Destructor Documentation

◆ StringMapImpl() [1/3]

wpi::StringMapImpl::StringMapImpl ( unsigned  itemSize)
inlineexplicitprotected

◆ StringMapImpl() [2/3]

wpi::StringMapImpl::StringMapImpl ( StringMapImpl &&  RHS)
inlineprotectednoexcept

◆ StringMapImpl() [3/3]

wpi::StringMapImpl::StringMapImpl ( unsigned  InitSize,
unsigned  ItemSize 
)
protected

Member Function Documentation

◆ empty()

bool wpi::StringMapImpl::empty ( ) const
inline

◆ FindKey()

int wpi::StringMapImpl::FindKey ( std::string_view  Key) const
protected

FindKey - Look up the bucket that contains the specified key.

If it exists in the map, return the bucket number of the key. Otherwise return -1. This does not modify the map.

◆ getNumBuckets()

unsigned wpi::StringMapImpl::getNumBuckets ( ) const
inline

◆ getNumItems()

unsigned wpi::StringMapImpl::getNumItems ( ) const
inline

◆ getTombstoneVal()

static StringMapEntryBase * wpi::StringMapImpl::getTombstoneVal ( )
inlinestatic

◆ init()

void wpi::StringMapImpl::init ( unsigned  Size)
protected

Allocate the table with the specified number of buckets and otherwise setup the map as empty.

◆ LookupBucketFor()

unsigned wpi::StringMapImpl::LookupBucketFor ( std::string_view  Key)
protected

LookupBucketFor - Look up the bucket that the specified string should end up in.

If it already exists as a key in the map, the Item pointer for the specified bucket will be non-null. Otherwise, it will be null. In either case, the FullHashValue field of the bucket will be set to the hash value of the string.

◆ RehashTable()

unsigned wpi::StringMapImpl::RehashTable ( unsigned  BucketNo = 0)
protected

◆ RemoveKey() [1/2]

StringMapEntryBase * wpi::StringMapImpl::RemoveKey ( std::string_view  Key)
protected

RemoveKey - Remove the StringMapEntry for the specified key from the table, returning it.

If the key is not in the table, this returns null.

◆ RemoveKey() [2/2]

void wpi::StringMapImpl::RemoveKey ( StringMapEntryBase V)
protected

RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it.

This aborts if the value isn't in the table.

◆ size()

unsigned wpi::StringMapImpl::size ( ) const
inline

◆ swap()

void wpi::StringMapImpl::swap ( StringMapImpl Other)
inline

Member Data Documentation

◆ ItemSize

unsigned wpi::StringMapImpl::ItemSize
protected

◆ NumBuckets

unsigned wpi::StringMapImpl::NumBuckets = 0
protected

◆ NumItems

unsigned wpi::StringMapImpl::NumItems = 0
protected

◆ NumTombstones

unsigned wpi::StringMapImpl::NumTombstones = 0
protected

◆ TheTable

StringMapEntryBase** wpi::StringMapImpl::TheTable = nullptr
protected

◆ TombstoneIntVal

constexpr uintptr_t wpi::StringMapImpl::TombstoneIntVal
staticconstexpr
Initial value:
=
static_cast<uintptr_t>(-1)
<< PointerLikeTypeTraits<StringMapEntryBase *>::NumLowBitsAvailable
uint128_t uintptr_t
Definition: format.h:484

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