24#ifndef DD_CACHE__ELEMENT_MAP_INCLUDED
25#define DD_CACHE__ELEMENT_MAP_INCLUDED
71template <
typename K,
typename E>
74 typedef std::map<K, E *, std::less<K>,
77 typedef typename Element_map_type::const_iterator
79 typedef typename Element_map_type::iterator
Iterator;
83 std::set<K, std::less<K>,
154 void get(
const K &
key, E **element)
const {
156 typename Element_map_type::const_iterator it =
m_map.find(
key);
157 if (it ==
m_map.end())
161 *element = it->second;
243 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:63
Implementation of a map between a key type and an element type.
Definition: element_map.h:72
Element_map()
Definition: element_map.h:88
Element_map_type::iterator Iterator
Definition: element_map.h:79
bool is_missed(const K &key) const
Check if the given key has been missed in the cache.
Definition: element_map.h:202
bool is_present(const K &key) const
Check if the given key is present in the map.
Definition: element_map.h:141
size_t size() const
Return the number of elements in the map.
Definition: element_map.h:129
void set_missed(const K &key)
Register the given key as being missed in the cache.
Definition: element_map.h:214
Const_iterator begin() const
Get an iterator to the beginning of the map.
Definition: element_map.h:104
void get(const K &key, E **element) const
Get the element associated with the given key.
Definition: element_map.h:154
std::map< K, E *, std::less< K >, Malloc_allocator< std::pair< const K, E * > > > Element_map_type
Definition: element_map.h:76
std::set< K, std::less< K >, Malloc_allocator< K > > m_missed
Definition: element_map.h:85
Const_iterator end() const
Get an iterator to one past the end of the map.
Definition: element_map.h:118
Element_map_type::const_iterator Const_iterator
Definition: element_map.h:78
void remove(const K &key)
Remove an element from the map.
Definition: element_map.h:190
Element_map_type m_map
Definition: element_map.h:82
void put(const K &key, E *element)
Put the element into the map and associate it with the given key.
Definition: element_map.h:174
Iterator begin()
Definition: element_map.h:107
void dump() const
Debug dump of the element map to stderr.
Definition: element_map.h:240
Iterator end()
Definition: element_map.h:121
void set_miss_handled(const K &key)
Register that the miss of a key has been handled.
Definition: element_map.h:227
uint16_t value_type
Definition: vt100.h:184
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
Definition: gcs_xcom_synode.h:64
PSI_memory_key key_memory_DD_cache_infrastructure
Definition: psi_memory_key.cc:37
required string key
Definition: replication_asynchronous_connection_failover.proto:60