MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rpl_info_table.h
1 /* Copyright (c) 2010, 2011, 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
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 #ifndef RPL_INFO_TABLE_H
17 #define RPL_INFO_TABLE_H
18 
19 #include "rpl_info_handler.h"
20 #include "rpl_info_table_access.h"
21 
30 enum enum_find_method { FIND_SCAN, FIND_KEY };
31 
32 class Rpl_info_table : public Rpl_info_handler
33 {
34  friend class Rpl_info_factory;
35 
36 public:
37  virtual ~Rpl_info_table();
38 
39 private:
44  LEX_STRING str_schema;
45 
50  LEX_STRING str_table;
51 
56  char *description;
57 
62  Rpl_info_table_access *access;
63 
68  bool is_transactional;
69 
70  int do_init_info();
71  int do_init_info(uint instance);
72  int do_init_info(enum_find_method method, uint instance);
73  enum_return_check do_check_info();
74  enum_return_check do_check_info(uint instance);
75  void do_end_info();
76  int do_flush_info(const bool force);
77  int do_remove_info();
78  int do_clean_info();
91  static bool do_count_info(uint nparam, const char* param_schema,
92  const char* param_table, uint* counter);
93  static int do_reset_info(uint nparam, const char* param_schema,
94  const char *param_table);
95  int do_prepare_info_for_read();
96  int do_prepare_info_for_write();
97 
98  bool do_set_info(const int pos, const char *value);
99  bool do_set_info(const int pos, const uchar *value,
100  const size_t size);
101  bool do_set_info(const int pos, const int value);
102  bool do_set_info(const int pos, const ulong value);
103  bool do_set_info(const int pos, const float value);
104  bool do_set_info(const int pos, const Dynamic_ids *value);
105  bool do_get_info(const int pos, char *value, const size_t size,
106  const char *default_value);
107  bool do_get_info(const int pos, uchar *value, const size_t size,
108  const uchar *default_value);
109  bool do_get_info(const int pos, int *value,
110  const int default_value);
111  bool do_get_info(const int pos, ulong *value,
112  const ulong default_value);
113  bool do_get_info(const int pos, float *value,
114  const float default_value);
115  bool do_get_info(const int pos, Dynamic_ids *value,
116  const Dynamic_ids *default_value);
117  char* do_get_description_info();
118 
119  bool do_is_transactional();
120  bool do_update_is_transactional();
121  uint do_get_rpl_info_type();
122 
123  Rpl_info_table(uint nparam,
124  const char* param_schema,
125  const char *param_table);
126 
127  Rpl_info_table(const Rpl_info_table& info);
128  Rpl_info_table& operator=(const Rpl_info_table& info);
129 };
130 #endif /* RPL_INFO_TABLE_H */