MySQL 8.0.39
Source Code Documentation
my_metadata.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_REGISTRY_METADATA_H
25#define MYSQL_REGISTRY_METADATA_H
26
27#include <memory>
28#include <string>
29#include <unordered_map>
30
31typedef std::string my_string;
32
33typedef std::unordered_map<my_string, my_string>
35
36/**
37 The metadata class used by both the registry and the dynamic loader services
38 to store and manage metadata information related to specified objects.
39*/
41 protected:
43
44 public:
47
48 /**
49 The data type of the iterator used.
50 Keep consistent with the type of the underlying data structure
51 */
53 : public my_unordered_string_to_string_map::const_iterator {
55
56 public:
57 const_iterator(my_unordered_string_to_string_map::const_iterator iter,
59
61 bool is_at_end();
62 };
63
64 /* update service */
65 bool set_value(const char *name, const char *value);
66
67 /* query service */
68 bool get_value(const char *name, const char **value);
69
70 /* enumeration service */
71
73
74 static bool release_iterator(const_iterator *iter);
75};
76
77#endif /* MYSQL_REGISTRY_METADATA_H */
The data type of the iterator used.
Definition: my_metadata.h:53
bool is_at_end()
Checks if iterator is pointing behind the end element.
Definition: my_metadata.cc:45
const_iterator(my_unordered_string_to_string_map::const_iterator iter, my_unordered_string_to_string_map *data_arg)
Definition: my_metadata.cc:30
my_unordered_string_to_string_map * get_data()
Gets pointer to structure the iterator is iterating over.
Definition: my_metadata.cc:38
my_unordered_string_to_string_map * data
Definition: my_metadata.h:54
The metadata class used by both the registry and the dynamic loader services to store and manage meta...
Definition: my_metadata.h:40
static bool release_iterator(const_iterator *iter)
Frees an iterator over the metadata.
Definition: my_metadata.cc:124
my_metadata(my_metadata &other)
my_unordered_string_to_string_map data
Definition: my_metadata.h:42
const_iterator create_iterator()
Creates an iterator over the metadata.
Definition: my_metadata.cc:111
bool set_value(const char *name, const char *value)
Sets a value for the name specified.
Definition: my_metadata.cc:61
bool get_value(const char *name, const char **value)
Gets value for the name specified.
Definition: my_metadata.cc:90
std::string my_string
Definition: my_metadata.h:31
std::unordered_map< my_string, my_string > my_unordered_string_to_string_map
Definition: my_metadata.h:34
case opt name
Definition: sslopt-case.h:33