MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_sync_instances.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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 as published by
5  the Free Software Foundation; version 2 of the License.
6 
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.
11 
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 Foundation,
14  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15 
16 #ifndef TABLE_SYNC_INSTANCE_H
17 #define TABLE_SYNC_INSTANCE_H
18 
24 #include "pfs_column_types.h"
25 #include "pfs_engine_table.h"
26 
27 struct PFS_mutex;
28 struct PFS_rwlock;
29 struct PFS_cond;
30 
38 {
40  const char *m_name;
44  const void *m_identity;
46  bool m_locked;
49 };
50 
53 {
54 public:
57  static PFS_engine_table* create();
58 
59  virtual int rnd_next();
60  virtual int rnd_pos(const void *pos);
61  virtual void reset_position(void);
62 
63 private:
64  virtual int read_row_values(TABLE *table,
65  unsigned char *buf,
66  Field **fields,
67  bool read_all);
68 
70 
71 public:
73  {}
74 
75 private:
76  void make_row(PFS_mutex *pfs);
77 
79  static THR_LOCK m_table_lock;
81  static TABLE_FIELD_DEF m_field_def;
82 
84  row_mutex_instances m_row;
86  bool m_row_exists;
88  PFS_simple_index m_pos;
90  PFS_simple_index m_next_pos;
91 };
92 
95 {
97  const char *m_name;
101  const void *m_identity;
107  ulong m_readers;
108 };
109 
112 {
113 public:
116  static PFS_engine_table* create();
117 
118  virtual int rnd_next();
119  virtual int rnd_pos(const void *pos);
120  virtual void reset_position(void);
121 
122 private:
123  virtual int read_row_values(TABLE *table,
124  unsigned char *buf,
125  Field **fields,
126  bool read_all);
127 
129 
130 public:
132  {}
133 
134 private:
135  void make_row(PFS_rwlock *pfs);
136 
138  static THR_LOCK m_table_lock;
140  static TABLE_FIELD_DEF m_field_def;
141 
143  row_rwlock_instances m_row;
145  bool m_row_exists;
147  PFS_simple_index m_pos;
149  PFS_simple_index m_next_pos;
150 };
151 
154 {
156  const char *m_name;
160  const void *m_identity;
161 };
162 
165 {
166 public:
169  static PFS_engine_table* create();
170 
171  virtual int rnd_next();
172  virtual int rnd_pos(const void *pos);
173  virtual void reset_position(void);
174 
175 private:
176  virtual int read_row_values(TABLE *table,
177  unsigned char *buf,
178  Field **fields,
179  bool read_all);
180 
182 
183 public:
185  {}
186 
187 private:
188  void make_row(PFS_cond *pfs);
189 
191  static THR_LOCK m_table_lock;
193  static TABLE_FIELD_DEF m_field_def;
194 
196  row_cond_instances m_row;
198  bool m_row_exists;
200  PFS_simple_index m_pos;
202  PFS_simple_index m_next_pos;
203 };
204 
206 #endif