map.h
This section contains reference documentation for working with protocol buffer classes in C++.
#include <google/protobuf/map.h>
namespace google::protobuf
This file defines the map container and its helpers to support protobuf maps.
The Map and MapIterator types are provided by this header file. Please avoid using other types defined here, unless they are public types within Map or MapIterator, such as Map::value_type.
Classes in this file | |
|---|---|
This is the class for Map's internal value_type. | |
Map is an associative container type used to store protobuf map fields. | |
Iterators. | |
template alias MapPair
#include <google/protobuf/map.h>
namespace google::protobuf
template <typename , typename >
This is the class for Map's internal value_type, which is just an alias to std::pair.
template class Map
#include <google/protobuf/map.h>
namespace google::protobuf
template <typename , typename >
Map is an associative container type used to store protobuf map fields.
Each Map instance may or may not use a different hash function, a different iteration order, and so on. E.g., please don't examine implementation details to decide if the following would work: Map<int, int> m0, m1; m0[0] = m1[0] = m0[1] = m1[1] = 0; assert(m0.begin()->first == m1.begin()->first); // Bug!
Map's interface is similar to std::unordered_map, except that Map is not designed to play well with exceptions.
Members | |
|---|---|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
constexpr |
|
explicit |
|
|
|
|
|
Map & |
|
template |
|
|
|
iterator |
|
iterator |
|
const_iterator |
|
const_iterator |
|
const_iterator |
|
const_iterator |
|
size_type |
Capacity. |
bool |
|
template T & |
Element access. |
template T & |
|
template const T & |
|
template T & |
|
template size_type |
Lookup. |
template const_iterator |
|
template iterator |
|
template bool |
|
template std::pair< const_iterator, const_iterator > |
|
template std::pair< iterator, iterator > |
|
std::pair< iterator, bool > |
insert |
template void |
|
void |
|
template size_type |
Erase and clear. |
iterator |
|
void | |
void |
|
Map & |
Assign. |
void |
|
void |
|
hasher |
Access to hasher. more... |
size_t |
|
hasher Map::hash_function() const
Access to hasher.
Currently this returns a copy, but it may be modified to return a const reference in the future.
class Map::const_iterator
#include <google/protobuf/map.h>
namespace google::protobuf
Iterators.
Members | |
|---|---|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
|
|
explicit |
|
const_reference |
|
const_pointer |
|
const_iterator & |
|
const_iterator |
|
class Map::iterator
#include <google/protobuf/map.h>
namespace google::protobuf
Members | |
|---|---|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
typedef |
|
|
|
explicit |
|
reference |
|
pointer |
|
iterator & |
|
iterator |
|
|
Allow implicit conversion to const_iterator. |