~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/registry.h

  • Committer: Brian Aker
  • Date: 2010-02-15 18:29:31 UTC
  • mto: (1273.13.68 build)
  • mto: This revision was merged to the branch mainline in revision 1303.
  • Revision ID: brian@gaz-20100215182931-ooy48h72plspoehy
More removal of show code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
private:
43
43
  std::map<std::string, Library *> library_map;
44
44
  std::map<std::string, Module *> module_map;
45
 
  std::map<std::string, Plugin *> plugin_registry;
 
45
  std::map<std::string, const Plugin *> plugin_registry;
 
46
 
 
47
  Module *current_module;
46
48
 
47
49
  Registry()
48
50
   : module_map(),
49
 
     plugin_registry()
 
51
     plugin_registry(),
 
52
     current_module(NULL)
50
53
  { }
51
54
 
52
55
  Registry(const Registry&);
66
69
 
67
70
  void add(Module *module);
68
71
 
 
72
  void setCurrentModule(Module *module)
 
73
  {
 
74
    current_module= module;
 
75
  }
 
76
 
 
77
  void clearCurrentModule()
 
78
  {
 
79
    current_module= NULL;
 
80
  }
69
81
 
70
82
  std::vector<Module *> getList(bool active);
71
83
 
72
 
  const std::map<std::string, Plugin *> &getPluginsMap() const
 
84
  const std::map<std::string, const Plugin *> &getPluginsMap() const
73
85
  {
74
86
    return plugin_registry;
75
87
  }
86
98
  template<class T>
87
99
  void add(T *plugin)
88
100
  {
 
101
    plugin->setModule(current_module);
89
102
    bool failed= false;
90
103
    std::string plugin_name(plugin->getName());
91
104
    std::transform(plugin_name.begin(), plugin_name.end(),
106
119
                    plugin->getName().c_str());
107
120
      unireg_abort(1);
108
121
    }
109
 
    plugin_registry.insert(std::pair<std::string, Plugin *>(plugin_name, plugin));
 
122
    plugin_registry.insert(std::pair<std::string, const Plugin *>(plugin_name, plugin));
110
123
  }
111
124
 
112
125
  template<class T>