My Project
|
00001 /* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; version 2 of the License. 00006 00007 This program is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 GNU General Public License for more details. 00011 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software 00014 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00015 00016 #ifndef RPL_INFO_TABLE_H 00017 #define RPL_INFO_TABLE_H 00018 00019 #include "rpl_info_handler.h" 00020 #include "rpl_info_table_access.h" 00021 00030 enum enum_find_method { FIND_SCAN, FIND_KEY }; 00031 00032 class Rpl_info_table : public Rpl_info_handler 00033 { 00034 friend class Rpl_info_factory; 00035 00036 public: 00037 virtual ~Rpl_info_table(); 00038 00039 private: 00044 LEX_STRING str_schema; 00045 00050 LEX_STRING str_table; 00051 00056 char *description; 00057 00062 Rpl_info_table_access *access; 00063 00068 bool is_transactional; 00069 00070 int do_init_info(); 00071 int do_init_info(uint instance); 00072 int do_init_info(enum_find_method method, uint instance); 00073 enum_return_check do_check_info(); 00074 enum_return_check do_check_info(uint instance); 00075 void do_end_info(); 00076 int do_flush_info(const bool force); 00077 int do_remove_info(); 00078 int do_clean_info(); 00091 static bool do_count_info(uint nparam, const char* param_schema, 00092 const char* param_table, uint* counter); 00093 static int do_reset_info(uint nparam, const char* param_schema, 00094 const char *param_table); 00095 int do_prepare_info_for_read(); 00096 int do_prepare_info_for_write(); 00097 00098 bool do_set_info(const int pos, const char *value); 00099 bool do_set_info(const int pos, const uchar *value, 00100 const size_t size); 00101 bool do_set_info(const int pos, const int value); 00102 bool do_set_info(const int pos, const ulong value); 00103 bool do_set_info(const int pos, const float value); 00104 bool do_set_info(const int pos, const Dynamic_ids *value); 00105 bool do_get_info(const int pos, char *value, const size_t size, 00106 const char *default_value); 00107 bool do_get_info(const int pos, uchar *value, const size_t size, 00108 const uchar *default_value); 00109 bool do_get_info(const int pos, int *value, 00110 const int default_value); 00111 bool do_get_info(const int pos, ulong *value, 00112 const ulong default_value); 00113 bool do_get_info(const int pos, float *value, 00114 const float default_value); 00115 bool do_get_info(const int pos, Dynamic_ids *value, 00116 const Dynamic_ids *default_value); 00117 char* do_get_description_info(); 00118 00119 bool do_is_transactional(); 00120 bool do_update_is_transactional(); 00121 uint do_get_rpl_info_type(); 00122 00123 Rpl_info_table(uint nparam, 00124 const char* param_schema, 00125 const char *param_table); 00126 00127 Rpl_info_table(const Rpl_info_table& info); 00128 Rpl_info_table& operator=(const Rpl_info_table& info); 00129 }; 00130 #endif /* RPL_INFO_TABLE_H */