23#ifndef DD_CACHE__ELEMENT_MAP_INCLUDED
24#define DD_CACHE__ELEMENT_MAP_INCLUDED
70template <
typename K,
typename E>
73 typedef std::map<K, E *, std::less<K>,
76 typedef typename Element_map_type::const_iterator
78 typedef typename Element_map_type::iterator
Iterator;
82 std::set<K, std::less<K>,
153 void get(
const K &
key, E **element)
const {
155 typename Element_map_type::const_iterator it =
m_map.find(
key);
156 if (it ==
m_map.end())
160 *element = it->second;
242 for (it =
m_map.begin(); it !=
m_map.end(); it++) it->second->dump();
Malloc_allocator is a C++ STL memory allocator based on my_malloc/my_free.
Definition: malloc_allocator.h:62
Implementation of a map between a key type and an element type.
Definition: element_map.h:71
Element_map()
Definition: element_map.h:87
Element_map_type::iterator Iterator
Definition: element_map.h:78
bool is_missed(const K &key) const
Check if the given key has been missed in the cache.
Definition: element_map.h:201
bool is_present(const K &key) const
Check if the given key is present in the map.
Definition: element_map.h:140
size_t size() const
Return the number of elements in the map.
Definition: element_map.h:128
void set_missed(const K &key)
Register the given key as being missed in the cache.
Definition: element_map.h:213
Const_iterator begin() const
Get an iterator to the beginning of the map.
Definition: element_map.h:103
void get(const K &key, E **element) const
Get the element associated with the given key.
Definition: element_map.h:153
std::map< K, E *, std::less< K >, Malloc_allocator< std::pair< const K, E * > > > Element_map_type
Definition: element_map.h:75
std::set< K, std::less< K >, Malloc_allocator< K > > m_missed
Definition: element_map.h:84
Const_iterator end() const
Get an iterator to one past the end of the map.
Definition: element_map.h:117
Element_map_type::const_iterator Const_iterator
Definition: element_map.h:77
void remove(const K &key)
Remove an element from the map.
Definition: element_map.h:189
Element_map_type m_map
Definition: element_map.h:81
void put(const K &key, E *element)
Put the element into the map and associate it with the given key.
Definition: element_map.h:173
Iterator begin()
Definition: element_map.h:106
void dump() const
Debug dump of the element map to stderr.
Definition: element_map.h:239
Iterator end()
Definition: element_map.h:120
void set_miss_handled(const K &key)
Register that the miss of a key has been handled.
Definition: element_map.h:226
uint16_t value_type
Definition: vt100.h:183
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
Definition: varlen_sort.h:183
PSI_memory_key key_memory_DD_cache_infrastructure
Definition: psi_memory_key.cc:36
required string key
Definition: replication_asynchronous_connection_failover.proto:59