~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/registry.cc

Added support for the global list of plugin::Plugin objects to slot::Function

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
  transform(find_str.begin(), find_str.end(), find_str.begin(), ::tolower);
40
40
 
41
41
  map<string, plugin::Handle *>::iterator map_iter;
42
 
  map_iter= plugin_map.find(find_str);
43
 
  if (map_iter != plugin_map.end())
 
42
  map_iter= handle_map.find(find_str);
 
43
  if (map_iter != handle_map.end())
44
44
    return (*map_iter).second;
45
45
  return(0);
46
46
}
47
47
 
48
 
void plugin::Registry::add(plugin::Handle *plugin)
 
48
void plugin::Registry::add(plugin::Handle *handle)
49
49
{
50
 
  string add_str(plugin->getName());
 
50
  string add_str(handle->getName());
51
51
  transform(add_str.begin(), add_str.end(),
52
52
            add_str.begin(), ::tolower);
53
53
 
54
 
  plugin_map[add_str]= plugin;
55
 
}
56
 
 
 
54
  handle_map[add_str]= handle;
 
55
}
 
56
 
 
57
void plugin::Registry::add(plugin::Plugin *plugin)
 
58
{
 
59
  plugin->setHandle(current_handle);
 
60
  plugin_registry.add(plugin); 
 
61
}
 
62
 
 
63
void plugin::Registry::remove(const plugin::Plugin *plugin)
 
64
{
 
65
  plugin_registry.remove(plugin);
 
66
}
57
67
 
58
68
vector<plugin::Handle *> plugin::Registry::get_list(bool active)
59
69
{
60
70
  plugin::Handle *plugin= NULL;
61
71
 
62
72
  vector <plugin::Handle *> plugins;
63
 
  plugins.reserve(plugin_map.size());
 
73
  plugins.reserve(handle_map.size());
64
74
 
65
75
  map<string, plugin::Handle *>::iterator map_iter;
66
 
  for (map_iter= plugin_map.begin();
67
 
       map_iter != plugin_map.end();
 
76
  for (map_iter= handle_map.begin();
 
77
       map_iter != handle_map.end();
68
78
       map_iter++)
69
79
  {
70
80
    plugin= (*map_iter).second;