MySQL 8.0.39
Source Code Documentation
keyring_keys_metadata_iterator_service_definition.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 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 KEYRING_KEYS_METADATA_FORWARD_ITERATOR_SERVICE_IMPL_INCLUDED
25#define KEYRING_KEYS_METADATA_FORWARD_ITERATOR_SERVICE_IMPL_INCLUDED
26
29
31
32namespace keyring_common {
33namespace service_definition {
34
36 public:
37 /**
38 Forward iterator initialization
39
40 @param [out] forward_iterator metadata iterator
41
42 @returns Status of the operation
43 @retval false Success
44 @retval true Failure
45 */
46
48 forward_iterator));
49
50 /**
51 Iterator deinitialization
52
53 Note: forward_iterator should not be used after call to deinit
54
55 @param [in, out] forward_iterator metadata iterator
56
57 @returns Status of the operation
58 @retval false Success
59 @retval true Failure
60 */
61
62 static DEFINE_BOOL_METHOD(
64
65 /**
66 Check validity of the iterator
67
68 @param [in] forward_iterator metadata iterator
69
70 @returns Validty of the iterator
71 @retval true Iterator is valid
72 @retval false Iterator is invalid
73 */
74 static DEFINE_BOOL_METHOD(
76
77 /**
78 Move iterator forward.
79
80 @param [in,out] forward_iterator metadata iterator
81
82 @returns Status of the operation
83 @retval false Success - indicates that iterator is pointing to next entry
84 @retval true Failure - indicates that iterator has reached the end
85 */
86
87 static DEFINE_BOOL_METHOD(
88 next, (my_h_keyring_keys_metadata_iterator forward_iterator));
89
90 /**
91 Fetch length metadata for current key pointed by iterator
92
93 @param [in] forward_iterator forward_iterator metadata iterator
94 @param [out] data_id_length Length of data_id buffer
95 @param [out] auth_id_length Length of auth_id buffer
96
97 @returns Status of the operation
98 @retval false Success
99 @retval true Failure
100 */
101 static DEFINE_BOOL_METHOD(
103 size_t *data_id_length, size_t *auth_id_length));
104
105 /**
106 Fetch metadata for current key pointed by iterator
107
108 @param [in] forward_iterator forward_iterator metadata iterator
109 @param [out] data_id ID information of current data
110 @param [in] data_id_length Length of data_id buffer
111 @param [out] auth_id Owner of the key
112 @param [in] auth_id_length Length of auth_id buffer
113
114 @returns Status of the operation
115 @retval false Success
116 @retval true Failure
117 */
118 static DEFINE_BOOL_METHOD(
119 get, (my_h_keyring_keys_metadata_iterator forward_iterator, char *data_id,
120 size_t data_id_length, char *auth_id, size_t auth_id_length));
121};
122
123} // namespace service_definition
124} // namespace keyring_common
125
126#define KEYRING_KEYS_METADATA_FORWARD_ITERATOR_IMPLEMENTOR(component_name) \
127 BEGIN_SERVICE_IMPLEMENTATION(component_name, keyring_keys_metadata_iterator) \
128 keyring_common::service_definition:: \
129 Keyring_keys_metadata_iterator_service_impl::init, \
130 keyring_common::service_definition:: \
131 Keyring_keys_metadata_iterator_service_impl::deinit, \
132 keyring_common::service_definition:: \
133 Keyring_keys_metadata_iterator_service_impl::is_valid, \
134 keyring_common::service_definition:: \
135 Keyring_keys_metadata_iterator_service_impl::next, \
136 keyring_common::service_definition:: \
137 Keyring_keys_metadata_iterator_service_impl::get_length, \
138 keyring_common::service_definition:: \
139 Keyring_keys_metadata_iterator_service_impl::get \
140 END_SERVICE_IMPLEMENTATION()
141
142#endif // KEYRING_KEYS_METADATA_FORWARD_ITERATOR_SERVICE_IMPL_INCLUDED
Definition: keyring_keys_metadata_iterator_service_definition.h:35
static mysql_service_status_t init(my_h_keyring_keys_metadata_iterator *forward_iterator) noexcept
Forward iterator initialization.
Definition: keyring_keys_metadata_iterator_service_definition.cc:46
static mysql_service_status_t get_length(my_h_keyring_keys_metadata_iterator forward_iterator, size_t *data_id_length, size_t *auth_id_length) noexcept
Fetch length metadata for current key pointed by iterator.
Definition: keyring_keys_metadata_iterator_service_definition.cc:88
static mysql_service_status_t get(my_h_keyring_keys_metadata_iterator forward_iterator, char *data_id, size_t data_id_length, char *auth_id, size_t auth_id_length) noexcept
Fetch metadata for current key pointed by iterator.
Definition: keyring_keys_metadata_iterator_service_definition.cc:102
static mysql_service_status_t next(my_h_keyring_keys_metadata_iterator forward_iterator) noexcept
Move iterator forward.
Definition: keyring_keys_metadata_iterator_service_definition.cc:76
static mysql_service_status_t deinit(my_h_keyring_keys_metadata_iterator forward_iterator) noexcept
Iterator deinitialization.
Definition: keyring_keys_metadata_iterator_service_definition.cc:57
static mysql_service_status_t is_valid(my_h_keyring_keys_metadata_iterator forward_iterator) noexcept
Check validity of the iterator.
Definition: keyring_keys_metadata_iterator_service_definition.cc:65
Specifies macros to define Components.
struct my_h_keyring_keys_metadata_iterator_imp * my_h_keyring_keys_metadata_iterator
Definition: keyring_keys_metadata_iterator.h:29
Definition: keyring_encryption_service_definition.h:32
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88