24#ifndef DD_CACHE__OBJECT_REGISTRY_INCLUDED
25#define DD_CACHE__OBJECT_REGISTRY_INCLUDED
76 std::unique_ptr<Local_multi_map<Spatial_reference_system>>
204 template <
typename T>
209 template <
typename T>
227 template <
typename T>
229 return m_map<T>()->begin();
244 template <
typename T>
246 return m_map<T>()->end();
262 template <
typename K,
typename T>
264 const auto map = m_map<T>();
278 template <
typename T>
282 m_map<T>()->put(element);
292 template <
typename T>
297 const auto map = m_map<T>();
298 assert(
map !=
nullptr);
299 if (
map) m_map<T>()->remove(element);
308 template <
typename T>
313 const auto map = m_map<T>();
314 if (
map) m_map<T>()->erase();
322 erase<Abstract_table>();
325 erase<Column_statistics>();
327 erase<Resource_group>();
330 erase<Spatial_reference_system>();
341 template <
typename T>
343 const auto map = m_map<T>();
344 if (
map)
return map->size();
355 return size<Abstract_table>() + size<Charset>() + size<Collation>() +
356 size<Column_statistics>() + size<Event>() + size<Resource_group>() +
357 size<Routine>() + size<Schema>() + size<Spatial_reference_system>() +
368 template <
typename T>
371 const auto map = m_map<T>();
Implementation of a dictionary client.
Definition: cache_element.h:69
Implementation of a local set of maps for a given object type.
Definition: local_multi_map.h:53
Element_map< constT *, Cache_element< T > >::Iterator Iterator
Definition: multi_map_base.h:128
Object registry containing several maps.
Definition: object_registry.h:62
Local_multi_map< Tablespace > * m_map(Type_selector< Tablespace >)
Definition: object_registry.h:179
void erase()
Remove and delete all objects of a given type from the registry.
Definition: object_registry.h:309
Local_multi_map< Event > * m_map(Type_selector< Event >)
Definition: object_registry.h:136
const Local_multi_map< Event > * m_map(Type_selector< Event >) const
Definition: object_registry.h:140
void put(Cache_element< T > *element)
Add a new element to the registry.
Definition: object_registry.h:279
std::unique_ptr< Local_multi_map< Event > > m_event_map
Definition: object_registry.h:72
const Local_multi_map< Resource_group > * m_map(Type_selector< Resource_group >) const
Definition: object_registry.h:148
T * create_map_if_needed(std::unique_ptr< T > *map)
Create a map instance unless it exists already.
Definition: object_registry.h:91
const Local_multi_map< Column_statistics > * m_map(Type_selector< Column_statistics >) const
Definition: object_registry.h:131
size_t size() const
Get the number of objects of a given type in the registry.
Definition: object_registry.h:342
void create_map(std::unique_ptr< T > *map)
Definition: dd.cc:112
const Local_multi_map< Routine > * m_map(Type_selector< Routine >) const
Definition: object_registry.h:157
std::unique_ptr< Local_multi_map< Tablespace > > m_tablespace_map
Definition: object_registry.h:78
Local_multi_map< T > * m_map()
Template function to get a map instance.
Definition: object_registry.h:205
const Local_multi_map< Collation > * m_map(Type_selector< Collation >) const
Definition: object_registry.h:123
void erase_all()
Remove and delete all objects from the registry.
Definition: object_registry.h:321
Local_multi_map< Resource_group > * m_map(Type_selector< Resource_group >)
Definition: object_registry.h:144
std::unique_ptr< Local_multi_map< Collation > > m_collation_map
Definition: object_registry.h:70
std::unique_ptr< Local_multi_map< Routine > > m_routine_map
Definition: object_registry.h:74
Multi_map_base< T >::Iterator end()
Get an iterator to one past the end of the local reverse map.
Definition: object_registry.h:245
void remove(Cache_element< T > *element)
Remove an element from the registry.
Definition: object_registry.h:293
std::unique_ptr< Local_multi_map< Abstract_table > > m_abstract_table_map
Definition: object_registry.h:68
const Local_multi_map< Schema > * m_map(Type_selector< Schema >) const
Definition: object_registry.h:165
void get(const K &key, Cache_element< T > **element) const
Get the element corresponding to the given key.
Definition: object_registry.h:263
size_t size_all() const
Get the total number of objects in the registry.
Definition: object_registry.h:354
Local_multi_map< Collation > * m_map(Type_selector< Collation >)
Definition: object_registry.h:119
Local_multi_map< Abstract_table > * m_map(Type_selector< Abstract_table >)
Overloaded functions to use for selecting map instance based on a key type.
Definition: object_registry.h:102
Local_multi_map< Column_statistics > * m_map(Type_selector< Column_statistics >)
Definition: object_registry.h:127
std::unique_ptr< Local_multi_map< Column_statistics > > m_column_statistics_map
Definition: object_registry.h:71
Multi_map_base< T >::Iterator begin()
Get an iterator to the beginning of the local reverse map.
Definition: object_registry.h:228
std::unique_ptr< Local_multi_map< Resource_group > > m_resource_group_map
Definition: object_registry.h:73
const Local_multi_map< Abstract_table > * m_map(Type_selector< Abstract_table >) const
Definition: object_registry.h:106
void dump() const
Debug dump of the object registry to stderr.
Definition: object_registry.h:369
const Local_multi_map< Charset > * m_map(Type_selector< Charset >) const
Definition: object_registry.h:115
std::unique_ptr< Local_multi_map< Charset > > m_charset_map
Definition: object_registry.h:69
Local_multi_map< Routine > * m_map(Type_selector< Routine >)
Definition: object_registry.h:153
std::unique_ptr< Local_multi_map< Schema > > m_schema_map
Definition: object_registry.h:75
const Local_multi_map< Tablespace > * m_map(Type_selector< Tablespace >) const
Definition: object_registry.h:183
const Local_multi_map< T > * m_map() const
Definition: object_registry.h:210
Local_multi_map< Spatial_reference_system > * m_map(Type_selector< Spatial_reference_system >)
Definition: object_registry.h:169
Local_multi_map< Charset > * m_map(Type_selector< Charset >)
Definition: object_registry.h:111
Local_multi_map< Schema > * m_map(Type_selector< Schema >)
Definition: object_registry.h:161
const Local_multi_map< Spatial_reference_system > * m_map(Type_selector< Spatial_reference_system >) const
Definition: object_registry.h:174
std::unique_ptr< Local_multi_map< Spatial_reference_system > > m_spatial_reference_system_map
Definition: object_registry.h:77
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
std::map< Key, Value, Compare, ut::allocator< std::pair< const Key, Value > > > map
Specialization of map which uses ut_allocator.
Definition: ut0new.h:2893
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Definition: object_registry.h:65