~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_registry.cc

Merging Eric's refactoring and cleanup of Listen and Protocol

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <map>
38
38
 
39
39
using namespace std;
 
40
using namespace drizzled;
40
41
 
41
42
static PluginRegistry the_registry;
42
43
 
45
46
  return the_registry;
46
47
}
47
48
 
48
 
drizzled::plugin::Handle *PluginRegistry::find(const LEX_STRING *name)
 
49
plugin::Handle *PluginRegistry::find(const LEX_STRING *name)
49
50
{
50
51
  string find_str(name->str,name->length);
51
52
  transform(find_str.begin(), find_str.end(), find_str.begin(), ::tolower);
52
53
 
53
 
  map<string, drizzled::plugin::Handle *>::iterator map_iter;
 
54
  map<string, plugin::Handle *>::iterator map_iter;
54
55
  map_iter= plugin_map.find(find_str);
55
56
  if (map_iter != plugin_map.end())
56
57
    return (*map_iter).second;
57
58
  return(0);
58
59
}
59
60
 
60
 
void PluginRegistry::add(drizzled::plugin::Handle *plugin)
 
61
void PluginRegistry::add(plugin::Handle *plugin)
61
62
{
62
63
  string add_str(plugin->getName());
63
64
  transform(add_str.begin(), add_str.end(),
67
68
}
68
69
 
69
70
 
70
 
vector<drizzled::plugin::Handle *> PluginRegistry::get_list(bool active)
 
71
vector<plugin::Handle *> PluginRegistry::get_list(bool active)
71
72
{
72
 
  drizzled::plugin::Handle *plugin= NULL;
 
73
  plugin::Handle *plugin= NULL;
73
74
 
74
 
  vector <drizzled::plugin::Handle *> plugins;
 
75
  vector <plugin::Handle *> plugins;
75
76
  plugins.reserve(plugin_map.size());
76
77
 
77
 
  map<string, drizzled::plugin::Handle *>::iterator map_iter;
 
78
  map<string, plugin::Handle *>::iterator map_iter;
78
79
  for (map_iter= plugin_map.begin();
79
80
       map_iter != plugin_map.end();
80
81
       map_iter++)
124
125
  add_query_cache(qcache);
125
126
}
126
127
 
127
 
void PluginRegistry::add(SchedulerFactory *factory)
 
128
void PluginRegistry::add(plugin::SchedulerFactory *factory)
128
129
{
129
130
  add_scheduler_factory(factory);
130
131
}
131
132
 
132
 
void PluginRegistry::add(const Listen &listen_obj)
 
133
void PluginRegistry::add(const plugin::Listen &listen_obj)
133
134
{
134
135
  add_listen(listen_obj);
135
136
}
136
137
 
137
 
void PluginRegistry::add(drizzled::plugin::Replicator *replicator)
 
138
void PluginRegistry::add(plugin::Replicator *replicator)
138
139
{
139
140
  add_replicator(replicator);
140
141
}
141
142
 
142
 
void PluginRegistry::add(drizzled::plugin::Applier *applier)
 
143
void PluginRegistry::add(plugin::Applier *applier)
143
144
{
144
145
  add_applier(applier);
145
146
}
179
180
  remove_query_cache(qcache);
180
181
}
181
182
 
182
 
void PluginRegistry::remove(SchedulerFactory *factory)
 
183
void PluginRegistry::remove(plugin::SchedulerFactory *factory)
183
184
{
184
185
  remove_scheduler_factory(factory);
185
186
}
186
187
 
187
 
void PluginRegistry::remove(const Listen &listen_obj)
 
188
void PluginRegistry::remove(const plugin::Listen &listen_obj)
188
189
{
189
190
  remove_listen(listen_obj);
190
191
}
191
192
 
192
 
void PluginRegistry::remove(drizzled::plugin::Replicator *replicator)
 
193
void PluginRegistry::remove(plugin::Replicator *replicator)
193
194
{
194
195
  remove_replicator(replicator);
195
196
}
196
197
 
197
 
void PluginRegistry::remove(drizzled::plugin::Applier *applier)
 
198
void PluginRegistry::remove(plugin::Applier *applier)
198
199
{
199
200
  remove_applier(applier);
200
201
}