MySQL
9.3.0
Source Code Documentation
field.h
Go to the documentation of this file.
1
// Copyright (c) 2024, 2025, Oracle and/or its affiliates.
2
//
3
// This program is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License, version 2.0,
5
// as published by the Free Software Foundation.
6
//
7
// This program is designed to work with certain software (including
8
// but not limited to OpenSSL) that is licensed under separate terms,
9
// as designated in a particular file or component or in included license
10
// documentation. The authors of MySQL hereby grant you an additional
11
// permission to link the program and your derivative works with the
12
// separately licensed software that they have either included with
13
// the program or referenced in the documentation.
14
//
15
// This program is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU General Public License, version 2.0, for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with this program; if not, write to the Free Software
22
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
24
#ifndef MYSQL_ABI_HELPERS_FIELD_H
25
#define MYSQL_ABI_HELPERS_FIELD_H
26
27
/// @file
28
/// Experimental API header
29
30
#include <cstdlib>
// std::size_t
31
#include <type_traits>
// std::is_enum_v
32
33
/// @addtogroup GroupLibsMysqlAbiHelpers
34
/// @{
35
36
namespace
mysql::abi_helpers
{
37
38
union
Value_union
{
39
long
long
m_int
;
40
bool
m_bool
;
41
char
*
m_string
;
42
};
43
44
/// A type code and a value that is either a 64 bit integer, a boolean, or a
45
/// bounded-length string.
46
template
<
class
Type_enum_tp>
47
requires
requires
{ std::is_enum_v<Type_enum_tp>; }
48
class
Field
{
49
public
:
50
using
Type_enum_t
= Type_enum_tp;
51
52
/// @brief The type of the field
53
Type_enum_t
m_type
;
54
55
/// @brief The data of the field
56
Value_union
m_data
;
57
};
58
59
}
// namespace mysql::abi_helpers
60
61
// addtogroup GroupLibsMysqlAbiHelpers
62
/// @}
63
64
#endif
// ifndef MYSQL_ABI_HELPERS_FIELD_H
mysql::abi_helpers::Field
A type code and a value that is either a 64 bit integer, a boolean, or a bounded-length string.
Definition:
field.h:48
mysql::abi_helpers::Field::m_data
Value_union m_data
The data of the field.
Definition:
field.h:56
mysql::abi_helpers::Field::m_type
Type_enum_t m_type
The type of the field.
Definition:
field.h:53
mysql::abi_helpers::Field::Type_enum_t
Type_enum_tp Type_enum_t
Definition:
field.h:50
mysql::abi_helpers
Definition:
array_view.h:42
mysql::abi_helpers::Value_union
Definition:
field.h:38
mysql::abi_helpers::Value_union::m_int
long long m_int
Definition:
field.h:39
mysql::abi_helpers::Value_union::m_string
char * m_string
Definition:
field.h:41
mysql::abi_helpers::Value_union::m_bool
bool m_bool
Definition:
field.h:40
libs
mysql
abi_helpers
field.h
Generated by
1.9.2