MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ListTables.hpp
1 /*
2  Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef LIST_TABLES_HPP
19 #define LIST_TABLES_HPP
20 
21 #include <Bitmask.hpp>
22 #include "SignalData.hpp"
23 
25 {
26  Uint32 requestData;
27  Uint32 tableId;
28  Uint32 tableType;
29 
30  void init() {
31  requestData = 0;
32  }
33 
34  Uint32 getTableId() const {
35  return tableId;
36  }
37 
38  void setTableId(Uint32 val) {
39  tableId = val;
40  }
41 
42  Uint32 getTableType() const {
43  return tableType;
44  }
45 
46  void setTableType(Uint32 val) {
47  tableType = val;
48  }
49 
50  Uint32 getTableStore() const {
51  return BitmaskImpl::getField(1, &requestData, 20, 3);
52  }
53  void setTableStore(Uint32 val) {
54  BitmaskImpl::setField(1, &requestData, 20, 3, val);
55  }
56  Uint32 getTableTemp() const {
57  return BitmaskImpl::getField(1, &requestData, 23, 1);
58  }
59  void setTableTemp(Uint32 val) {
60  BitmaskImpl::setField(1, &requestData, 23, 1, val);
61  }
62  Uint32 getTableState() const {
63  return BitmaskImpl::getField(1, &requestData, 24, 4);
64  }
65  void setTableState(Uint32 val) {
66  BitmaskImpl::setField(1, &requestData, 24, 4, val);
67  }
68  Uint32 getListNames() const {
69  return BitmaskImpl::getField(1, &requestData, 28, 1);
70  }
71  void setListNames(Uint32 val) {
72  BitmaskImpl::setField(1, &requestData, 28, 1, val);
73  }
74  Uint32 getListIndexes() const {
75  return BitmaskImpl::getField(1, &requestData, 29, 1);
76  }
77  void setListIndexes(Uint32 val) {
78  BitmaskImpl::setField(1, &requestData, 29, 1, val);
79  }
80 };
81 
89 public:
90  static Uint32 getTableId(Uint32 data) {
91  return BitmaskImpl::getField(1, &data, 0, 12);
92  }
93  static void setTableId(Uint32& data, Uint32 val) {
94  BitmaskImpl::setField(1, &data, 0, 12, val);
95  }
96  static Uint32 getTableType(Uint32 data) {
97  return BitmaskImpl::getField(1, &data, 12, 8);
98  }
99  static void setTableType(Uint32& data, Uint32 val) {
100  BitmaskImpl::setField(1, &data, 12, 8, val);
101  }
102  static Uint32 getTableStore(Uint32 data) {
103  return BitmaskImpl::getField(1, &data, 20, 3);
104  }
105  static void setTableStore(Uint32& data, Uint32 val) {
106  BitmaskImpl::setField(1, &data, 20, 3, val);
107  }
108  static Uint32 getTableTemp(Uint32 data) {
109  return BitmaskImpl::getField(1, &data, 23, 1);
110  }
111  static void setTableTemp(Uint32& data, Uint32 val) {
112  BitmaskImpl::setField(1, &data, 23, 1, val);
113  }
114  static Uint32 getTableState(Uint32 data) {
115  return BitmaskImpl::getField(1, &data, 24, 4);
116  }
117  static void setTableState(Uint32& data, Uint32 val) {
118  BitmaskImpl::setField(1, &data, 24, 4, val);
119  }
120  static Uint32 getListNames(Uint32 data) {
121  return BitmaskImpl::getField(1, &data, 28, 1);
122  }
123  static void setListNames(Uint32& data, Uint32 val) {
124  BitmaskImpl::setField(1, &data, 28, 1, val);
125  }
126  static Uint32 getListIndexes(Uint32 data) {
127  return BitmaskImpl::getField(1, &data, 29, 1);
128  }
129  static void setListIndexes(Uint32& data, Uint32 val) {
130  BitmaskImpl::setField(1, &data, 29, 1, val);
131  }
132 };
133 
138  friend class Backup;
139  friend class Table;
140  friend class Suma;
141 
145  friend class Dbdict;
146 
147 public:
148  STATIC_CONST( oldSignalLength = 3 );
149  STATIC_CONST( SignalLength = 5 );
150 
151 public:
152  Uint32 senderData;
153  Uint32 senderRef;
154  ListTablesData data;
155 
156  void init(){
157  data.init();
158  }
159 
160  Uint32 getTableId() const {
161  return data.getTableId();
162  }
163  void setTableId(Uint32 val) {
164  data.setTableId(val);
165  }
166  Uint32 getTableType() const {
167  return data.getTableType();
168  }
169  void setTableType(Uint32 val) {
170  data.setTableType(val);
171  }
172  Uint32 getListNames() const {
173  return data.getListNames();
174  }
175  void setListNames(Uint32 val) {
176  data.setListNames(val);
177  }
178  Uint32 getListIndexes() const {
179  return data.getListIndexes();
180  }
181  void setListIndexes(Uint32 val) {
182  data.setListIndexes(val);
183  }
184 
185 
186  /* For backwards compatility */
187  Uint32 oldGetTableId() {
188  return OldListTablesData::getTableId(data.requestData);
189  }
190  void oldSetTableId(Uint32 val) {
191  OldListTablesData::setTableId(data.requestData, val);
192  }
193  Uint32 oldGetTableType() const {
194  return OldListTablesData::getTableType(data.requestData);
195  }
196  void oldSetTableType(Uint32 val) {
197  OldListTablesData::setTableType(data.requestData, val);
198  }
199 };
200 
205  friend class Dbdict;
206 
210  friend class Backup;
211  friend class Table;
212 
213 public:
214  STATIC_CONST( SignalLength = 2 );
215 
216 public:
217  Uint32 senderData;
218  Uint32 noOfTables;
219 
220  SECTION( TABLE_DATA = 0 );
221  SECTION( TABLE_NAMES = 1 );
222 };
223 
228  friend class Dbdict;
229 
233  friend class Backup;
234  friend class Table;
235 
236 public:
240  STATIC_CONST( SignalLength = 25 );
241  STATIC_CONST( HeaderLength = 2 );
242  STATIC_CONST( DataLength = 23 );
243 
244 public:
245  Uint32 senderData;
246  Uint32 counter;
247  Uint32 tableData[DataLength];
248 
249  static Uint32 getTableId(Uint32 data) {
250  return OldListTablesData::getTableId(data);
251  }
252  void setTableId(unsigned pos, Uint32 val) {
253  OldListTablesData::setTableId(tableData[pos], val);
254  }
255  static Uint32 getTableType(Uint32 data) {
256  return OldListTablesData::getTableType(data);
257  }
258  void setTableType(unsigned pos, Uint32 val) {
259  OldListTablesData::setTableType(tableData[pos], val);
260  }
261  static Uint32 getTableStore(Uint32 data) {
262  return OldListTablesData::getTableStore(data);
263  }
264  void setTableStore(unsigned pos, Uint32 val) {
265  OldListTablesData::setTableStore(tableData[pos], val);
266  }
267  static Uint32 getTableState(Uint32 data) {
268  return OldListTablesData::getTableState(data);
269  }
270  void setTableState(unsigned pos, Uint32 val) {
271  OldListTablesData::setTableState(tableData[pos], val);
272  }
273  static Uint32 getTableTemp(Uint32 data) {
274  return OldListTablesData::getTableTemp(data);
275  }
276  void setTableTemp(unsigned pos, Uint32 val) {
277  OldListTablesData::setTableTemp(tableData[pos], val);
278  }
279 };
280 
281 #endif