MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_setup_actors.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_SETUP_ACTORS_H
17 #define TABLE_SETUP_ACTORS_H
18 
24 #include "pfs_engine_table.h"
25 
26 struct PFS_setup_actor;
27 
35 {
37  char m_hostname[HOSTNAME_LENGTH];
41  char m_username[USERNAME_LENGTH];
45  char m_rolename[16];
48 };
49 
52 {
53 public:
57  static PFS_engine_table* create();
58  static int write_row(TABLE *table, unsigned char *buf, Field **fields);
59  static int delete_all_rows();
60  static ha_rows get_row_count();
61 
62  virtual int rnd_next();
63  virtual int rnd_pos(const void *pos);
64  virtual void reset_position(void);
65 
66 protected:
67  virtual int read_row_values(TABLE *table,
68  unsigned char *buf,
69  Field **fields,
70  bool read_all);
71 
72  virtual int update_row_values(TABLE *table,
73  const unsigned char *old_buf,
74  unsigned char *new_buf,
75  Field **fields);
76 
77  virtual int delete_row_values(TABLE *table,
78  const unsigned char *buf,
79  Field **fields);
80 
82 
83 public:
85  {}
86 
87 private:
88  void make_row(PFS_setup_actor *actor);
89 
91  static THR_LOCK m_table_lock;
93  static TABLE_FIELD_DEF m_field_def;
94 
96  row_setup_actors m_row;
98  bool m_row_exists;
100  PFS_simple_index m_pos;
102  PFS_simple_index m_next_pos;
103 };
104 
106 #endif