class UntypedMapBase
Defined at line 554 of file ../../third_party/protobuf/src/google/protobuf/map.h
Base class for all Map instantiations.
This class holds all the data and provides the basic functionality shared
among all instantiations.
Having an untyped base class helps generic consumers (like the table-driven
parser) by having non-template code that can handle all instantiations.
Protected Members
map_index_t num_elements_
map_index_t num_buckets_
map_index_t seed_
map_index_t index_of_first_non_null_
TableEntryPtr * table_
MapAllocator alloc_
Public Methods
void UntypedMapBase (Arena * arena)
Defined at line 561 of file ../../third_party/protobuf/src/google/protobuf/map.h
void UntypedMapBase (const UntypedMapBase & )
Defined at line 569 of file ../../third_party/protobuf/src/google/protobuf/map.h
UntypedMapBase & operator= (const UntypedMapBase & )
Defined at line 570 of file ../../third_party/protobuf/src/google/protobuf/map.h
Arena * arena ()
Defined at line 577 of file ../../third_party/protobuf/src/google/protobuf/map.h
void InternalSwap (UntypedMapBase * other)
Defined at line 579 of file ../../third_party/protobuf/src/google/protobuf/map.h
size_type max_size ()
Defined at line 588 of file ../../third_party/protobuf/src/google/protobuf/map.h
size_type size ()
Defined at line 591 of file ../../third_party/protobuf/src/google/protobuf/map.h
bool empty ()
Defined at line 592 of file ../../third_party/protobuf/src/google/protobuf/map.h
UntypedMapIterator EndIterator ()
We make this a static function to reduce the cost in MapField.
All the end iterators are singletons anyway.
Defined at line 597 of file ../../third_party/protobuf/src/google/protobuf/map.h
UntypedMapIterator begin ()
Defined at line 817 of file ../../third_party/protobuf/src/google/protobuf/map.h
Protected Methods
NodeBase * DestroyTree (Tree * tree)
void InsertUniqueInTree (map_index_t b, GetKey get_key, NodeBase * node)
void TransferTree (Tree * tree, GetKey get_key)
TableEntryPtr ConvertToTree (NodeBase * node, GetKey get_key)
void EraseFromTree (map_index_t b, typename Tree::iterator tree_it)
void ClearTable (ClearInput input)
NodeAndBucket FindFromTree (map_index_t b, VariantKey key, Tree::iterator * it)
size_t SpaceUsedInTable (size_t sizeof_node)
Space used for the table, trees, and nodes.
Does not include the indirect space used. Eg the data of a std::string.
bool ShouldInsertAfterHead (void * node)
Returns whether we should insert after the head of the list. For
non-optimized builds, we randomly decide whether to insert right at the
head of the list or just after the head. This helps add a little bit of
non-determinism to the map ordering.
Defined at line 615 of file ../../third_party/protobuf/src/google/protobuf/map.h
void InsertUniqueInList (map_index_t b, NodeBase * node)
Helper for InsertUnique. Handles the case where bucket b is a
not-too-long linked list.
Defined at line 627 of file ../../third_party/protobuf/src/google/protobuf/map.h
bool TableEntryIsEmpty (map_index_t b)
Defined at line 638 of file ../../third_party/protobuf/src/google/protobuf/map.h
bool TableEntryIsNonEmptyList (map_index_t b)
Defined at line 641 of file ../../third_party/protobuf/src/google/protobuf/map.h
bool TableEntryIsTree (map_index_t b)
Defined at line 644 of file ../../third_party/protobuf/src/google/protobuf/map.h
bool TableEntryIsList (map_index_t b)
Defined at line 647 of file ../../third_party/protobuf/src/google/protobuf/map.h
bool TableEntryIsTooLong (map_index_t b)
Return whether table_[b] is a linked list that seems awfully long.
Requires table_[b] to point to a non-empty linked list.
Defined at line 653 of file ../../third_party/protobuf/src/google/protobuf/map.h
map_index_t TableSize (map_index_t n)
Return a power of two no less than max(kMinTableSize, n).
Assumes either n
<
kMinTableSize or n is a power of two.
Defined at line 659 of file ../../third_party/protobuf/src/google/protobuf/map.h
NodeBase * AllocNode (MapNodeSizeInfoT size_info)
Alignment of the nodes is the same as alignment of NodeBase.
Defined at line 667 of file ../../third_party/protobuf/src/google/protobuf/map.h
NodeBase * AllocNode (size_t node_size)
Defined at line 671 of file ../../third_party/protobuf/src/google/protobuf/map.h
void DeallocNode (NodeBase * node, MapNodeSizeInfoT size_info)
Defined at line 676 of file ../../third_party/protobuf/src/google/protobuf/map.h
void DeallocNode (NodeBase * node, size_t node_size)
Defined at line 680 of file ../../third_party/protobuf/src/google/protobuf/map.h
void DeleteTable (TableEntryPtr * table, map_index_t n)
Defined at line 685 of file ../../third_party/protobuf/src/google/protobuf/map.h
map_index_t VariantBucketNumber (VariantKey key)
Defined at line 700 of file ../../third_party/protobuf/src/google/protobuf/map.h
map_index_t VariantBucketNumber (absl::string_view key)
Defined at line 707 of file ../../third_party/protobuf/src/google/protobuf/map.h
map_index_t VariantBucketNumber (uint64_t key)
Defined at line 712 of file ../../third_party/protobuf/src/google/protobuf/map.h
TableEntryPtr * CreateEmptyTable (map_index_t n)
Defined at line 717 of file ../../third_party/protobuf/src/google/protobuf/map.h
map_index_t Seed ()
Return a randomish value.
Defined at line 726 of file ../../third_party/protobuf/src/google/protobuf/map.h
template <typename Key, typename Value>
uint8_t MakeDestroyBits ()
Defined at line 759 of file ../../third_party/protobuf/src/google/protobuf/map.h
template <typename Node>
void DestroyNode (NodeBase * node)
Defined at line 788 of file ../../third_party/protobuf/src/google/protobuf/map.h
template <typename Node>
ClearInput MakeClearInput (bool reset)
Defined at line 793 of file ../../third_party/protobuf/src/google/protobuf/map.h
Enumerations
enum
| Name | Value |
|---|---|
| kMinTableSize | 16 / sizeof(void*) |
16 bytes is the minimum useful size for the array cache in the arena.
Defined at line 574 of file ../../third_party/protobuf/src/google/protobuf/map.h
enum
| Name | Value |
|---|---|
| kKeyIsString | 1 << 0 |
| kValueIsString | 1 << 1 |
| kValueIsProto | 1 << 2 |
| kUseDestructFunc | 1 << 3 |
Defined at line 752 of file ../../third_party/protobuf/src/google/protobuf/map.h
Records
Friends
class RustMapHelper
class UntypedMapIterator
class MapBenchmarkPeer
class MapTestPeer
class TcParser