/src/mysql-server/libs/mysql/gtid/gtid_format.h
Line | Count | Source |
1 | | // Copyright (c) 2023, 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_GTID_GTID_FORMAT_H |
25 | | #define MYSQL_GTID_GTID_FORMAT_H |
26 | | |
27 | | #include <array> |
28 | | #include <cstdint> |
29 | | #include <memory> |
30 | | #include <string> |
31 | | #include "mysql/utils/enumeration_utils.h" |
32 | | |
33 | | /// @addtogroup GroupLibsMysqlGtid |
34 | | /// @{ |
35 | | |
36 | | namespace mysql::gtid { |
37 | | |
38 | | /// @brief Gtid binary format indicator |
39 | | enum class Gtid_format : uint8_t { |
40 | | untagged = 0, // untagged GTID |
41 | | tagged = 1, // GTID with non-empty tag |
42 | | last, // no valid constant may appear after this constant |
43 | | }; |
44 | | |
45 | | } // namespace mysql::gtid |
46 | | |
47 | | namespace mysql::utils { |
48 | | // we need to provide enum_max specialization for Gtid_format in the |
49 | | // mysql::utils namespace |
50 | | template <> |
51 | | /// @brief Specialization of enum_max method for Gtid_format |
52 | | /// @return Maximum Gtid_format constant that can appear |
53 | 0 | constexpr inline gtid::Gtid_format enum_max<gtid::Gtid_format>() { |
54 | 0 | return gtid::Gtid_format::tagged; |
55 | 0 | } |
56 | | } // namespace mysql::utils |
57 | | |
58 | | /// @} |
59 | | |
60 | | #endif // MYSQL_GTID_GTID_FORMAT_H |