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