MySQL 8.3.0
Source Code Documentation
my_metadata.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MYSQL_REGISTRY_METADATA_H
24#define MYSQL_REGISTRY_METADATA_H
25
26#include <memory>
27#include <string>
28#include <unordered_map>
29
30typedef std::string my_string;
31
32typedef std::unordered_map<my_string, my_string>
34
35/**
36 The metadata class used by both the registry and the dynamic loader services
37 to store and manage metadata information related to specified objects.
38*/
40 protected:
42
43 public:
46
47 /**
48 The data type of the iterator used.
49 Keep consistent with the type of the underlying data structure
50 */
52 : public my_unordered_string_to_string_map::const_iterator {
54
55 public:
56 const_iterator(my_unordered_string_to_string_map::const_iterator iter,
58
60 bool is_at_end();
61 };
62
63 /* update service */
64 bool set_value(const char *name, const char *value);
65
66 /* query service */
67 bool get_value(const char *name, const char **value);
68
69 /* enumeration service */
70
72
73 static bool release_iterator(const_iterator *iter);
74};
75
76#endif /* MYSQL_REGISTRY_METADATA_H */
The data type of the iterator used.
Definition: my_metadata.h:52
bool is_at_end()
Checks if iterator is pointing behind the end element.
Definition: my_metadata.cc:44
const_iterator(my_unordered_string_to_string_map::const_iterator iter, my_unordered_string_to_string_map *data_arg)
Definition: my_metadata.cc:29
my_unordered_string_to_string_map * get_data()
Gets pointer to structure the iterator is iterating over.
Definition: my_metadata.cc:37
my_unordered_string_to_string_map * data
Definition: my_metadata.h:53
The metadata class used by both the registry and the dynamic loader services to store and manage meta...
Definition: my_metadata.h:39
static bool release_iterator(const_iterator *iter)
Frees an iterator over the metadata.
Definition: my_metadata.cc:123
my_metadata(my_metadata &other)
my_unordered_string_to_string_map data
Definition: my_metadata.h:41
const_iterator create_iterator()
Creates an iterator over the metadata.
Definition: my_metadata.cc:110
bool set_value(const char *name, const char *value)
Sets a value for the name specified.
Definition: my_metadata.cc:60
bool get_value(const char *name, const char **value)
Gets value for the name specified.
Definition: my_metadata.cc:89
std::string my_string
Definition: my_metadata.h:30
std::unordered_map< my_string, my_string > my_unordered_string_to_string_map
Definition: my_metadata.h:33
case opt name
Definition: sslopt-case.h:32