MySQL 9.0.0
Source Code Documentation
|
Object registry containing several maps. More...
#include <object_registry.h>
Classes | |
struct | Type_selector |
Public Member Functions | |
template<typename T > | |
Multi_map_base< T >::Iterator | begin () |
Get an iterator to the beginning of the local reverse map. More... | |
template<typename T > | |
Multi_map_base< T >::Iterator | end () |
Get an iterator to one past the end of the local reverse map. More... | |
template<typename K , typename T > | |
void | get (const K &key, Cache_element< T > **element) const |
Get the element corresponding to the given key. More... | |
template<typename T > | |
void | put (Cache_element< T > *element) |
Add a new element to the registry. More... | |
template<typename T > | |
void | remove (Cache_element< T > *element) |
Remove an element from the registry. More... | |
template<typename T > | |
void | erase () |
Remove and delete all objects of a given type from the registry. More... | |
void | erase_all () |
Remove and delete all objects from the registry. More... | |
template<typename T > | |
size_t | size () const |
Get the number of objects of a given type in the registry. More... | |
size_t | size_all () const |
Get the total number of objects in the registry. More... | |
template<typename T > | |
void | dump () const |
Debug dump of the object registry to stderr. More... | |
Private Attributes | |
std::unique_ptr< Local_multi_map< Abstract_table > > | m_abstract_table_map |
std::unique_ptr< Local_multi_map< Charset > > | m_charset_map |
std::unique_ptr< Local_multi_map< Collation > > | m_collation_map |
std::unique_ptr< Local_multi_map< Column_statistics > > | m_column_statistics_map |
std::unique_ptr< Local_multi_map< Event > > | m_event_map |
std::unique_ptr< Local_multi_map< Resource_group > > | m_resource_group_map |
std::unique_ptr< Local_multi_map< Routine > > | m_routine_map |
std::unique_ptr< Local_multi_map< Schema > > | m_schema_map |
std::unique_ptr< Local_multi_map< Spatial_reference_system > > | m_spatial_reference_system_map |
std::unique_ptr< Local_multi_map< Tablespace > > | m_tablespace_map |
Object registry containing several maps.
The registry is mainly a collection of maps for each type supported. The functions dispatch to the appropriate map based on the key and object type parameter. There is no support for locking or thread synchronization. The object registry is kind of the single threaded version of the shared dictionary cache.
The object registry is intended to be used as a thread local record of which objects have been used.
The individual maps containing DD object pointers are allocated on demand to avoid excessive performance overhead during object instantiation.
|
inline |
Get an iterator to the beginning of the local reverse map.
The reverse map is guaranteed to contain all elements, that why we use it for iteration. The other maps may not contain all elements since keys may be NULL.
T | Dictionary object type. |
|
private |
|
inlineprivate |
Create a map instance unless it exists already.
|
inline |
Debug dump of the object registry to stderr.
T | Dictionary object type. |
|
inline |
Get an iterator to one past the end of the local reverse map.
The reverse map is guaranteed to contain all elements, that why we use it for iteration. The other maps may not contain all elements since keys may be NULL.
T | Dictionary object type. |
|
inline |
Remove and delete all objects of a given type from the registry.
T | Dictionary object type. |
|
inline |
Remove and delete all objects from the registry.
|
inline |
Get the element corresponding to the given key.
K | Key type. |
T | Dictionary object type. |
key | Key too lookup. | |
[out] | element | Element, if present, otherwise, NULL. |
|
inlineprivate |
Template function to get a map instance.
To support generic code, the 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.
T | Dictionary object type. |
|
inlineprivate |
|
inlineprivate |
Overloaded functions to use for selecting map instance based on a key type.
Const and non-const variants. The non-const variants will create the map unless it exists.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
Add a new element to the registry.
T | Dictionary object type. |
element | Element to be added. |
|
inline |
Remove an element from the registry.
T | Dictionary object type. |
element | Element to be removed. |
|
inline |
Get the number of objects of a given type in the registry.
T | Dictionary object type. |
|
inline |
Get the total number of objects in the registry.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |