WPILibC++ 2024.3.2
|
StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes. More...
Public Types | |
using | MapEntryTy = StringMapEntry< ValueTy > |
using | key_type = const char * |
using | mapped_type = ValueTy |
using | value_type = StringMapEntry< ValueTy > |
using | size_type = size_t |
using | const_iterator = StringMapConstIterator< ValueTy > |
using | iterator = StringMapIterator< ValueTy > |
Public Member Functions | |
StringMap () | |
StringMap (unsigned InitialSize) | |
StringMap (AllocatorTy A) | |
StringMap (unsigned InitialSize, AllocatorTy A) | |
StringMap (std::initializer_list< std::pair< std::string_view, ValueTy > > List) | |
StringMap (StringMap &&RHS) | |
StringMap (const StringMap &RHS) | |
StringMap & | operator= (StringMap RHS) |
~StringMap () | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
iterator_range< StringMapKeyIterator< ValueTy > > | keys () const |
iterator | find (std::string_view Key) |
const_iterator | find (std::string_view Key) const |
ValueTy | lookup (std::string_view Key) const |
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists. More... | |
const ValueTy & | at (std::string_view Val) const |
at - Return the entry for the specified key, or abort if no such entry exists. More... | |
ValueTy & | operator[] (std::string_view Key) |
Lookup the ValueTy for the Key , or create a default constructed value if the key is not in the map. More... | |
bool | contains (std::string_view Key) const |
contains - Return true if the element is in the map, false otherwise. More... | |
size_type | count (std::string_view Key) const |
count - Return 1 if the element is in the map, 0 otherwise. More... | |
template<typename InputTy > | |
size_type | count (const StringMapEntry< InputTy > &MapEntry) const |
bool | operator== (const StringMap &RHS) const |
equal - check whether both of the containers are equal. More... | |
bool | operator!= (const StringMap &RHS) const |
bool | insert (MapEntryTy *KeyValue) |
insert - Insert the specified key/value pair into the map. More... | |
std::pair< iterator, bool > | insert (std::pair< std::string_view, ValueTy > KV) |
insert - Inserts the specified key/value pair into the map if the key isn't already in the map. More... | |
template<typename InputIt > | |
void | insert (InputIt First, InputIt Last) |
Inserts elements from range [first, last). More... | |
void | insert (std::initializer_list< std::pair< std::string_view, ValueTy > > List) |
Inserts elements from initializer list ilist. More... | |
template<typename V > | |
std::pair< iterator, bool > | insert_or_assign (std::string_view Key, V &&Val) |
Inserts an element or assigns to the current element if the key already exists. More... | |
template<typename... ArgsTy> | |
std::pair< iterator, bool > | try_emplace (std::string_view Key, ArgsTy &&...Args) |
Emplace a new element for the specified key into the map if the key isn't already in the map. More... | |
void | clear () |
void | remove (MapEntryTy *KeyValue) |
remove - Remove the specified key/value pair from the map, but do not erase it. More... | |
void | erase (iterator I) |
bool | erase (std::string_view Key) |
Alloc & | getAllocator () |
const Alloc & | getAllocator () const |
Public Member Functions inherited from wpi::StringMapImpl | |
unsigned | getNumBuckets () const |
unsigned | getNumItems () const |
bool | empty () const |
unsigned | size () const |
void | swap (StringMapImpl &Other) |
Additional Inherited Members | |
Static Public Member Functions inherited from wpi::StringMapImpl | |
static StringMapEntryBase * | getTombstoneVal () |
Static Public Attributes inherited from wpi::StringMapImpl | |
static constexpr uintptr_t | TombstoneIntVal |
Protected Member Functions inherited from wpi::StringMapImpl | |
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... | |
StringMapEntryBase * | RemoveKey (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 inherited from wpi::StringMapImpl | |
StringMapEntryBase ** | TheTable = nullptr |
unsigned | NumBuckets = 0 |
unsigned | NumItems = 0 |
unsigned | NumTombstones = 0 |
unsigned | ItemSize |
StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes.
This does some funky memory allocation and hashing things to make it extremely efficient, storing the string data after the value in the map.
using wpi::StringMap< ValueTy, AllocatorTy >::const_iterator = StringMapConstIterator<ValueTy> |
using wpi::StringMap< ValueTy, AllocatorTy >::iterator = StringMapIterator<ValueTy> |
using wpi::StringMap< ValueTy, AllocatorTy >::key_type = const char * |
using wpi::StringMap< ValueTy, AllocatorTy >::MapEntryTy = StringMapEntry<ValueTy> |
using wpi::StringMap< ValueTy, AllocatorTy >::mapped_type = ValueTy |
using wpi::StringMap< ValueTy, AllocatorTy >::size_type = size_t |
using wpi::StringMap< ValueTy, AllocatorTy >::value_type = StringMapEntry<ValueTy> |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
at - Return the entry for the specified key, or abort if no such entry exists.
|
inline |
|
inline |
|
inline |
|
inline |
contains - Return true if the element is in the map, false otherwise.
|
inline |
|
inline |
count - Return 1 if the element is in the map, 0 otherwise.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Inserts elements from range [first, last).
If multiple elements in the range have keys that compare equivalent, it is unspecified which element is inserted .
|
inline |
insert - Insert the specified key/value pair into the map.
If the key already exists in the map, return false and ignore the request, otherwise insert it and return true.
|
inline |
Inserts elements from initializer list ilist.
If multiple elements in the range have keys that compare equivalent, it is unspecified which element is inserted
|
inline |
insert - Inserts the specified key/value pair into the map if the key isn't already in the map.
The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of the pair.
|
inline |
Inserts an element or assigns to the current element if the key already exists.
The return type is the same as try_emplace.
|
inline |
|
inline |
lookup - Return the entry for the specified key, or a default constructed value if no such entry exists.
|
inline |
|
inline |
|
inline |
equal - check whether both of the containers are equal.
|
inline |
Lookup the ValueTy for the Key
, or create a default constructed value if the key is not in the map.
|
inline |
remove - Remove the specified key/value pair from the map, but do not erase it.
This aborts if the key is not in the map.
|
inline |
Emplace a new element for the specified key into the map if the key isn't already in the map.
The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of the pair.