11/*
2- Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
2+ Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
33
44 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU General Public License as published by
@@ -30,10 +30,6 @@ namespace Tools{
3030namespace Base {
3131namespace Options {
3232
33- using std::string;
34- using std::vector;
35- using Base::I_callable;
36-
3733class Abstract_options_provider ;
3834
3935/* *
@@ -50,7 +46,7 @@ template<typename T_type> class Abstract_option : public I_option
5046 I_Callable can be replaced with std::Function<void(char*)> once we get
5147 one.
5248 */
53- T_type* add_callback (I_callable<void , char *>* callback);
49+ T_type* add_callback (Mysql:: I_callable<void , char *>* callback);
5450
5551 /* *
5652 Sets optid to given character to make possible usage of short option
@@ -69,8 +65,8 @@ template<typename T_type> class Abstract_option : public I_option
6965 @param default_value default value to be supplied to internal option
7066 data structure.
7167 */
72- Abstract_option (void * value, ulong var_type, string name, string description ,
73- uint64 default_value);
68+ Abstract_option (void * value, ulong var_type, std:: string name,
69+ std::string description, uint64 default_value);
7470
7571 /* *
7672 Returns my_getopt internal option data structure representing this option.
@@ -90,7 +86,7 @@ template<typename T_type> class Abstract_option : public I_option
9086private:
9187 void call_callbacks (char * argument);
9288
93- vector<I_callable<void , char *>*> m_callbacks;
89+ std:: vector<Mysql:: I_callable<void , char *>*> m_callbacks;
9490 I_option_changed_listener* m_option_changed_listener;
9591
9692 friend class Abstract_options_provider ;
@@ -101,21 +97,24 @@ template<typename T_type> Abstract_option<T_type>::~Abstract_option()
10197 my_free ((void *)this ->m_option_structure .name );
10298 my_free ((void *)this ->m_option_structure .comment );
10399
104- for (vector<I_callable<void , char *>*>::iterator it= this ->m_callbacks .begin ();
100+ for (std::vector<Mysql::I_callable<void , char *>*>::iterator
101+ it= this ->m_callbacks .begin ();
105102 it != this ->m_callbacks .end ();
106103 it++)
107104 {
108105 delete *it;
109106 }
110107}
111108
112- template <typename T_type> T_type* Abstract_option<T_type>::add_callback(I_callable<void , char *>* callback)
109+ template <typename T_type> T_type* Abstract_option<T_type>::add_callback(
110+ Mysql::I_callable<void , char *>* callback)
113111{
114112 this ->m_callbacks .push_back (callback);
115113 return (T_type*)this ;
116114}
117115
118- template <typename T_type> T_type* Abstract_option<T_type>::set_short_character(char code)
116+ template <typename T_type> T_type* Abstract_option<T_type>::set_short_character(
117+ char code)
119118{
120119 // Change optid to new one
121120 uint32 old_optid= this ->m_option_structure .id ;
@@ -124,14 +123,16 @@ template<typename T_type> T_type* Abstract_option<T_type>::set_short_character(c
124123 // Inform that it has changed
125124 if (this ->m_option_changed_listener != NULL )
126125 {
127- this ->m_option_changed_listener ->notify_option_optid_changed (this , old_optid);
126+ this ->m_option_changed_listener ->notify_option_optid_changed (
127+ this , old_optid);
128128 }
129129
130130 return (T_type*)this ;
131131}
132132
133133template <typename T_type> Abstract_option<T_type>::Abstract_option(void * value,
134- ulong var_type, string name, string description, uint64 default_value)
134+ ulong var_type, std::string name, std::string description,
135+ uint64 default_value)
135136 : m_option_changed_listener(NULL )
136137{
137138 this ->m_option_structure .block_size = 0 ;
@@ -168,17 +169,21 @@ template<typename T_type> my_option Abstract_option<T_type>::get_my_option()
168169 return this ->m_option_structure ;
169170}
170171
171- template <typename T_type> void Abstract_option<T_type>::set_option_changed_listener(I_option_changed_listener* listener)
172+ template <typename T_type> void
173+ Abstract_option<T_type>::set_option_changed_listener(
174+ I_option_changed_listener* listener)
172175{
173176 DBUG_ASSERT (this ->m_option_changed_listener == NULL );
174177
175178 this ->m_option_changed_listener = listener;
176179}
177180
178- template <typename T_type> void Abstract_option<T_type>::call_callbacks(char * argument)
181+ template <typename T_type> void Abstract_option<T_type>::call_callbacks(
182+ char * argument)
179183{
180- vector<I_callable<void , char *>*>::iterator callback_it;
181- for (callback_it= this ->m_callbacks .begin (); callback_it != this ->m_callbacks .end (); callback_it++)
184+ std::vector<Mysql::I_callable<void , char *>*>::iterator callback_it;
185+ for (callback_it= this ->m_callbacks .begin ();
186+ callback_it != this ->m_callbacks .end (); callback_it++)
182187 {
183188 (**callback_it)(argument);
184189 }
0 commit comments