WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
wpi::StringMapImpl Class Reference

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

#include <StringMap.h>

Inheritance diagram for wpi::StringMapImpl:
wpi::StringMap< frc::ShuffleboardLayout * > wpi::StringMap< NT_Entry > wpi::StringMap< std::chrono::microseconds > wpi::StringMap< std::shared_ptr< nt::Value > > wpi::StringMap< T > wpi::StringMap< ValueTy >

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 ()
 

Protected Member Functions

 StringMapImpl (unsigned itemSize)
 
 StringMapImpl (StringMapImpl &&RHS)
 
 StringMapImpl (unsigned InitSize, unsigned ItemSize)
 
unsigned RehashTable (unsigned BucketNo=0)
 
unsigned LookupBucketFor (StringRef Key)
 LookupBucketFor - Look up the bucket that the specified string should end up in. More...
 
int FindKey (StringRef 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 (StringRef 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.

Member Function Documentation

int wpi::StringMapImpl::FindKey ( StringRef  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.

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

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

unsigned wpi::StringMapImpl::LookupBucketFor ( StringRef  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.

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.

StringMapEntryBase* wpi::StringMapImpl::RemoveKey ( StringRef  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.


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