MySQL 9.1.0
Source Code Documentation
partition_value.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2024, 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 DD__PARTITION_VALUE_INCLUDED
25#define DD__PARTITION_VALUE_INCLUDED
26
27#include "my_inttypes.h"
28#include "sql/dd/sdi_fwd.h" // dd::Sdi_wcontext
29#include "sql/dd/types/weak_object.h" // dd::Weak_object
30
31namespace dd {
32
33///////////////////////////////////////////////////////////////////////////
34
35class Column;
36class Partition;
37class Partition_value_impl;
38
39namespace tables {
40class Table_partition_values;
41}
42
43///////////////////////////////////////////////////////////////////////////
44
45class Partition_value : virtual public Weak_object {
46 public:
49
50 public:
51 ~Partition_value() override = default;
52
53 /////////////////////////////////////////////////////////////////////////
54 // Partition.
55 /////////////////////////////////////////////////////////////////////////
56
57 virtual const Partition &partition() const = 0;
58
59 virtual Partition &partition() = 0;
60
61 /////////////////////////////////////////////////////////////////////////
62 // list_num.
63 /////////////////////////////////////////////////////////////////////////
64
65 virtual uint list_num() const = 0;
66 virtual void set_list_num(uint list_num) = 0;
67
68 /////////////////////////////////////////////////////////////////////////
69 // column_num.
70 /////////////////////////////////////////////////////////////////////////
71
72 virtual uint column_num() const = 0;
73 virtual void set_column_num(uint column_num) = 0;
74
75 /////////////////////////////////////////////////////////////////////////
76 // value.
77 /////////////////////////////////////////////////////////////////////////
78
79 virtual const String_type &value_utf8() const = 0;
80 virtual void set_value_utf8(const String_type &value) = 0;
81
82 /////////////////////////////////////////////////////////////////////////
83 // max_value.
84 /////////////////////////////////////////////////////////////////////////
85
86 virtual bool max_value() const = 0;
87 virtual void set_max_value(bool max_value) = 0;
88
89 /////////////////////////////////////////////////////////////////////////
90 // null_value.
91 /////////////////////////////////////////////////////////////////////////
92
93 virtual bool is_value_null() const = 0;
94 virtual void set_value_null(bool is_null) = 0;
95
96 /**
97 Converts *this into json.
98
99 Converts all member variables that are to be included in the sdi
100 into json by transforming them appropriately and passing them to
101 the rapidjson writer provided.
102
103 @param wctx opaque context for data needed by serialization
104 @param w rapidjson writer which will perform conversion to json
105
106 */
107
108 virtual void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const = 0;
109
110 /**
111 Re-establishes the state of *this by reading sdi information from
112 the rapidjson DOM subobject provided.
113
114 Cross-references encountered within this object are tracked in
115 sdictx, so that they can be updated when the entire object graph
116 has been established.
117
118 @param rctx stores book-keeping information for the
119 deserialization process
120 @param val subobject of rapidjson DOM containing json
121 representation of this object
122 */
123
124 virtual bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val) = 0;
125};
126
127///////////////////////////////////////////////////////////////////////////
128
129} // namespace dd
130
131#endif // DD__PARTITION_VALUE_INCLUDED
Definition: partition_value_impl.h:52
Definition: partition_value.h:45
virtual void set_value_utf8(const String_type &value)=0
Partition_value_impl Impl
Definition: partition_value.h:47
virtual void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const =0
Converts *this into json.
virtual void set_value_null(bool is_null)=0
virtual bool is_value_null() const =0
virtual const Partition & partition() const =0
virtual uint column_num() const =0
virtual bool max_value() const =0
virtual void set_list_num(uint list_num)=0
virtual const String_type & value_utf8() const =0
tables::Table_partition_values DD_table
Definition: partition_value.h:48
~Partition_value() override=default
virtual Partition & partition()=0
virtual bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val)=0
Re-establishes the state of *this by reading sdi information from the rapidjson DOM subobject provide...
virtual uint list_num() const =0
virtual void set_column_num(uint column_num)=0
virtual void set_max_value(bool max_value)=0
Definition: partition.h:51
Opaque context which keeps reusable resoureces needed during deserialization.
Definition: sdi.cc:231
Opaque context which keeps reusable resources needed during serialization.
Definition: sdi.cc:129
Base class for all data dictionary objects.
Definition: weak_object.h:42
Definition: table_partition_values.h:38
Some integer typedefs for easier portability.
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
RJ_Writer Sdi_writer
Alias for the rapidjson Writer type to use in serialization.
Definition: sdi_fwd.h:64
rapidjson::GenericValue< RJ_Encoding, RJ_Allocator > RJ_Value
Definition: sdi_fwd.h:49
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
This header provides Rapidjson Type Aliases.