1 #ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H
2 #define INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H
3 /* Copyright (c) 2004-2006 MySQL AB
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
18 #include <my_global.h>
23 #if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
29 class Named_value_arr
;
30 class Thread_registry
;
32 extern int load_all_groups(char ***groups
, const char *filename
);
33 extern void free_groups(char **groups
);
35 extern int create_instance_in_file(const LEX_STRING
*instance_name
,
36 const Named_value_arr
*options
);
40 Instance_map - stores all existing instances
53 uint current_instance
;
54 Instance_map
*instance_map
;
56 Iterator(Instance_map
*instance_map_arg
) :
57 current_instance(0), instance_map(instance_map_arg
)
65 Instance
*find(const LEX_STRING
*name
);
67 bool is_there_active_instance();
77 int process_one_option(const LEX_STRING
*group
, const char *option
);
79 int add_instance(Instance
*instance
);
81 int remove_instance(Instance
*instance
);
83 int create_instance(const LEX_STRING
*instance_name
,
84 const Named_value_arr
*options
);
91 bool complete_initialization();
94 enum { START_HASH_SIZE
= 16 };
95 pthread_mutex_t LOCK_instance_map
;
99 friend class Iterator
;
102 #endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H */