MySQL 8.4.2
Source Code Documentation
|
Implementation of a set of maps for a given object type. More...
#include <multi_map_base.h>
Classes | |
struct | Type_selector |
Public Types | |
typedef Element_map< constT *, Cache_element< T > >::Const_iterator | Const_iterator |
typedef Element_map< constT *, Cache_element< T > >::Iterator | Iterator |
Protected Member Functions | |
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... | |
Private Member Functions | |
Element_map< const T *, Cache_element< T > > * | m_map (Type_selector< const T * >) |
Overloaded functions to use for selecting an element list instance based on a key type. More... | |
const Element_map< const T *, Cache_element< T > > * | m_map (Type_selector< const T * >) const |
Element_map< typename T::Id_key, Cache_element< T > > * | m_map (Type_selector< typename T::Id_key >) |
const Element_map< typename T::Id_key, Cache_element< T > > * | m_map (Type_selector< typename T::Id_key >) const |
Element_map< typename T::Name_key, Cache_element< T > > * | m_map (Type_selector< typename T::Name_key >) |
const Element_map< typename T::Name_key, Cache_element< T > > * | m_map (Type_selector< typename T::Name_key >) const |
Element_map< typename T::Aux_key, Cache_element< T > > * | m_map (Type_selector< typename T::Aux_key >) |
const Element_map< typename T::Aux_key, Cache_element< T > > * | m_map (Type_selector< typename T::Aux_key >) const |
Private Attributes | |
Element_map< const T *, Cache_element< T > > | m_rev_map |
Element_map< typename T::Id_key, Cache_element< T > > | m_id_map |
Element_map< typename T::Name_key, Cache_element< T > > | m_name_map |
Element_map< typename T::Aux_key, Cache_element< T > > | m_aux_map |
Implementation of a set of maps for a given object type.
The class declares a set of maps, each of which maps from a key type to an element type. The element type wraps the template object type parameter into a wrapper instance.
The implementation is intended to be used as a base to be extended for usage in a specific context. There is support for adding and removing elements in all maps with one operation (but not necessarily atomically), and for retrieving a single map. There is no support for tracking object usage, free list management, thread synchronization, etc.
T | Dictionary object type. |
typedef Element_map<constT*,Cache_element<T>>::Const_iterator dd::cache::Multi_map_base< T >::Const_iterator |
typedef Element_map<constT*,Cache_element<T>>::Iterator dd::cache::Multi_map_base< T >::Iterator |
|
protected |
Helper function to add a single element.
This function assumes that checking for key and element presence has already been done, that the object has been assigned, and that the keys have been generated.
element | Element to be added. |
|
inlineprotected |
Debug dump of the multi map base to stderr.
|
inlineprotected |
Template function to get an element map.
To support generic code, the element map instances are available through template function instances. This allows looking up the appropriate instance based on the key type. We must use overloading to accomplish this (see above). Const and non-const variants.
K | Key type. |
|
inlineprotected |
|
inlineprivate |
Overloaded functions to use for selecting an element list instance based on a key type.
Const and non-const variants.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
protected |
Helper function to remove the mapping of a single element, without deleting the element itself.
This function assumes that checking for key and element presence has already been done.
element | Element to be removed and deleted. |
|
private |
|
private |
|
private |
|
private |