MySQL 8.0.40
Source Code Documentation
|
Implementation of a local set of maps for a given object type. More...
#include <local_multi_map.h>
Public Member Functions | |
Multi_map_base< T >::Const_iterator | begin () const |
Get an iterator to the beginning of the map. More... | |
Multi_map_base< T >::Iterator | begin () |
Multi_map_base< T >::Const_iterator | end () const |
Get an iterator to one past the end of the map. More... | |
Multi_map_base< T >::Iterator | end () |
template<typename K > | |
void | get (const K &key, Cache_element< T > **element) const |
Get an element from the map handling the given key type. More... | |
void | put (Cache_element< T > *element) |
Put a new element into the map. More... | |
void | remove (Cache_element< T > *element) |
Remove an element from the map. More... | |
void | erase () |
Remove and delete all objects from the map. More... | |
size_t | size () const |
Get the number of elements in the map. More... | |
void | dump () const |
Debug dump of the local multi map to stderr. More... | |
Private Member Functions | |
template<typename K > | |
Element_map< K, Cache_element< T > > * | m_map () |
Template helper function getting the element map. More... | |
template<typename K > | |
const Element_map< K, Cache_element< T > > * | m_map () const |
Additional Inherited Members | |
Public Types inherited from dd::cache::Multi_map_base< T > | |
typedef Element_map< constT *, Cache_element< T > >::Const_iterator | Const_iterator |
typedef Element_map< constT *, Cache_element< T > >::Iterator | Iterator |
Protected Member Functions inherited from dd::cache::Multi_map_base< T > | |
template<typename K > | |
Element_map< K, Cache_element< T > > * | m_map () |
Template function to get an element map. More... | |
template<typename K > | |
const Element_map< K, Cache_element< T > > * | m_map () const |
void | remove_single_element (Cache_element< T > *element) |
Helper function to remove the mapping of a single element, without deleting the element itself. More... | |
void | add_single_element (Cache_element< T > *element) |
Helper function to add a single element. More... | |
void | dump () const |
Debug dump of the multi map base to stderr. More... | |
Implementation of a local set of maps for a given object type.
The implementation is an extension of the multi map base, adding support for iteration. It is intended to be used in a single threaded context, and there is no support for tracking object usage, free list management, thread synchronization, etc.
T | Dictionary object type. |
|
inline |
|
inline |
Get an iterator to the beginning of the map.
Const and non-const variants.
void dd::cache::Local_multi_map< T >::dump |
Debug dump of the local multi map to stderr.
|
inline |
|
inline |
Get an iterator to one past the end of the map.
Const and non-const variants.
void dd::cache::Local_multi_map< T >::erase |
Remove and delete all objects from the map.
This includes Cache_elements and the Dictionary objects themselves.
|
inline |
Get an element from the map handling the given key type.
If the element is present, return a pointer to it. Otherwise, return NULL.
K | Key type. |
key | Key to use for looking up the element. | |
[out] | element | Element pointer, if present, otherwise NULL. |
|
inlineprivate |
Template helper function getting the element map.
Const and non-const variants.
K | Key type. |
|
inlineprivate |
void dd::cache::Local_multi_map< T >::put | ( | Cache_element< T > * | element | ) |
Put a new element into the map.
None of the keys may exist in advance, and the wrapped object may not be present in this map already.
element | New element to be added. |
void dd::cache::Local_multi_map< T >::remove | ( | Cache_element< T > * | element | ) |
Remove an element from the map.
This function will remove the element from the multi map. This means that all keys associated with the element will be removed from the maps, and the cache element wrapper will be removed, but not deleted. The object itself is not deleted. It is up to the outer layer to decide what to do with the element and object.
element | Element to be removed. |
|
inline |
Get the number of elements in the map.