1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#ifndef LIST_TABLES_HPP
17
#define LIST_TABLES_HPP
19
#include <Bitmask.hpp>
20
#include "SignalData.hpp"
23
* It is convenient to pack request/response data per table in one
26
class ListTablesData {
28
static Uint32 getTableId(Uint32 data) {
29
return BitmaskImpl::getField(1, &data, 0, 12);
31
static void setTableId(Uint32& data, Uint32 val) {
32
BitmaskImpl::setField(1, &data, 0, 12, val);
34
static Uint32 getTableType(Uint32 data) {
35
return BitmaskImpl::getField(1, &data, 12, 8);
37
static void setTableType(Uint32& data, Uint32 val) {
38
BitmaskImpl::setField(1, &data, 12, 8, val);
40
static Uint32 getTableStore(Uint32 data) {
41
return BitmaskImpl::getField(1, &data, 20, 3);
43
static void setTableStore(Uint32& data, Uint32 val) {
44
BitmaskImpl::setField(1, &data, 20, 3, val);
46
static Uint32 getTableTemp(Uint32 data) {
47
return BitmaskImpl::getField(1, &data, 23, 1);
49
static void setTableTemp(Uint32& data, Uint32 val) {
50
BitmaskImpl::setField(1, &data, 23, 1, val);
52
static Uint32 getTableState(Uint32 data) {
53
return BitmaskImpl::getField(1, &data, 24, 4);
55
static void setTableState(Uint32& data, Uint32 val) {
56
BitmaskImpl::setField(1, &data, 24, 4, val);
58
static Uint32 getListNames(Uint32 data) {
59
return BitmaskImpl::getField(1, &data, 28, 1);
61
static void setListNames(Uint32& data, Uint32 val) {
62
BitmaskImpl::setField(1, &data, 28, 1, val);
64
static Uint32 getListIndexes(Uint32 data) {
65
return BitmaskImpl::getField(1, &data, 29, 1);
67
static void setListIndexes(Uint32& data, Uint32 val) {
68
BitmaskImpl::setField(1, &data, 29, 1, val);
86
STATIC_CONST( SignalLength = 3 );
94
return ListTablesData::getTableId(requestData);
96
void setTableId(Uint32 val) {
97
ListTablesData::setTableId(requestData, val);
99
Uint32 getTableType() const {
100
return ListTablesData::getTableType(requestData);
102
void setTableType(Uint32 val) {
103
ListTablesData::setTableType(requestData, val);
105
Uint32 getListNames() const {
106
return ListTablesData::getListNames(requestData);
108
void setListNames(Uint32 val) {
109
ListTablesData::setListNames(requestData, val);
111
Uint32 getListIndexes() const {
112
return ListTablesData::getListIndexes(requestData);
114
void setListIndexes(Uint32 val) {
115
ListTablesData::setListIndexes(requestData, val);
119
class ListTablesConf {
134
* Note: last signal is indicated by having length < 25
136
STATIC_CONST( SignalLength = 25 );
137
STATIC_CONST( HeaderLength = 2 );
138
STATIC_CONST( DataLength = 23 );
143
Uint32 tableData[DataLength];
145
static Uint32 getTableId(Uint32 data) {
146
return ListTablesData::getTableId(data);
148
void setTableId(unsigned pos, Uint32 val) {
149
ListTablesData::setTableId(tableData[pos], val);
151
static Uint32 getTableType(Uint32 data) {
152
return ListTablesData::getTableType(data);
154
void setTableType(unsigned pos, Uint32 val) {
155
ListTablesData::setTableType(tableData[pos], val);
157
static Uint32 getTableStore(Uint32 data) {
158
return ListTablesData::getTableStore(data);
160
void setTableStore(unsigned pos, Uint32 val) {
161
ListTablesData::setTableStore(tableData[pos], val);
163
static Uint32 getTableState(Uint32 data) {
164
return ListTablesData::getTableState(data);
166
void setTableState(unsigned pos, Uint32 val) {
167
ListTablesData::setTableState(tableData[pos], val);
169
static Uint32 getTableTemp(Uint32 data) {
170
return ListTablesData::getTableTemp(data);
172
void setTableTemp(unsigned pos, Uint32 val) {
173
ListTablesData::setTableTemp(tableData[pos], val);