MySQL 8.4.3
Source Code Documentation
|
Class to represent collections of meta data for entities. More...
#include <system_registry.h>
Public Types | |
typedef Entity_list_type::const_iterator | Const_iterator |
Public Member Functions | |
~Entity_registry () | |
Delete the heap memory owned by the entity registry. More... | |
void | add (const String_type &schema_name, const String_type &entity_name, P property, T *entity) |
Add a new entity to the registry. More... | |
const T * | find_entity (const String_type &schema_name, const String_type &entity_name) const |
Find an element entity in the registry. More... | |
const P * | find_property (const String_type &schema_name, const String_type &entity_name) const |
Find the property of an element in the registry. More... | |
Const_iterator | begin () const |
Get the beginning of the vector of ordered inserts. More... | |
Const_iterator | begin (P property) const |
Get the first element with a certain property. More... | |
Const_iterator | end () const |
Get the end of the vector of ordered inserts. More... | |
Const_iterator | next (Const_iterator current) const |
Get the next element in the list of ordered inserts. More... | |
Const_iterator | next (Const_iterator current, P property) const |
Get the next element in the list of ordered inserts. More... | |
void | dump () const |
Private Types | |
typedef Entity_element< K, T, P, F, D > | Entity_element_type |
typedef std::vector< Entity_element_type * > | Entity_list_type |
typedef std::map< K, Entity_element_type * > | Entity_map_type |
Private Attributes | |
Entity_list_type | m_entity_list |
List for ordered access. More... | |
Entity_map_type | m_entity_map |
Map for direct key based lookup. More... | |
Class to represent collections of meta data for entities.
This class is used to represent relevant meta data and properties of system related entities, e.g. all the dictionary tables. The meta data is associated with a key instance, usually a std::pair containing the schema- and entity names.
The class supports adding and retrieving objects, as well as iteration based on the order of inserts.
K | Key type. |
T | Entity type. |
P | Property type. |
F | Function to map from property to name. |
D | Boolean flag to decide whether the wrapped objects are owned by the registry. |
typedef Entity_list_type::const_iterator dd::Entity_registry< K, T, P, F, D >::Const_iterator |
|
private |
|
private |
|
private |
|
inline |
Delete the heap memory owned by the entity registry.
Only the wrapper elements are owned by the registry. The std::vector and std::map are not allocated dynamically, and their destructors are called implicitly when this destructor is called.
|
inline |
Add a new entity to the registry.
This method will create a new key and a new entity wrapper element. The wrapper will be added to the map, along with the key, and to the vector to keep track of the order of inserts.
schema_name | Schema name used to construct the key. |
entity_name | Entity name used to construct the key. |
property | Property used to classify the entity. |
entity | Entity which is classified and registered. |
|
inline |
Get the beginning of the vector of ordered inserts.
Iterator | referring to the first element in the vector, or end() if the vector is empty. |
|
inline |
Get the first element with a certain property.
This method retrieves the first element with a certain property, and is used for iterating only over elements having this property.
property | Property that the element should have. |
Iterator | referring to the first element in the vector with the submitted property, or end(). |
|
inline |
|
inline |
Get the end of the vector of ordered inserts.
Iterator | referring to the special element after the last "real" element in the vector. |
|
inline |
Find an element entity in the registry.
This method creates a key based on the submitted parameters, and looks up in the member map. If the key is found, the object pointed to by the wrapper is returned, otherwise, nullptr is returned.
schema_name | Schema containing the entity searched for. |
entity_name | Name of the entity searched for. |
nullptr | if not found, otherwise, the entity object pointed to by the wrapper element. |
|
inline |
Find the property of an element in the registry.
This method creates a key based on the submitted parameters, and looks up in the member map. If the key is found, the property associated with the key is returned, otherwise, nullptr is returned.
schema_name | Schema containing the entity searched for. |
entity_name | Name of the entity searched for. |
nullptr | if not found, otherwise, the a pointer to the property associated with the key. |
|
inline |
Get the next element in the list of ordered inserts.
current | The current iterator. |
Iterator | referring to the next element in the vector. |
|
inline |
Get the next element in the list of ordered inserts.
This method retrieves the next element with a certain property, and is used for iterating only over elements having this property.
current | The current iterator. |
property | Property that the next element should have. |
Iterator | referring to the next element in the vector with the submitted property. |
|
private |
List for ordered access.
|
private |
Map for direct key based lookup.