~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/registry.h

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_PLUGIN_REGISTRY_H
21
 
#define DRIZZLED_PLUGIN_REGISTRY_H
 
20
#ifndef DRIZZLED_MODULE_REGISTRY_H
 
21
#define DRIZZLED_MODULE_REGISTRY_H
22
22
 
23
23
#include <string>
24
24
#include <vector>
33
33
{
34
34
namespace plugin
35
35
{
 
36
class Plugin;
 
37
}
 
38
 
 
39
namespace module
 
40
{
36
41
class Module;
37
 
class Plugin;
38
42
class Library;
39
43
 
40
44
class Registry
42
46
private:
43
47
  std::map<std::string, Library *> library_map;
44
48
  std::map<std::string, Module *> module_map;
45
 
  std::map<std::string, Plugin *> plugin_registry;
 
49
  std::map<std::string, plugin::Plugin *> plugin_registry;
46
50
 
47
51
  Registry()
48
52
   : module_map(),
54
58
  ~Registry();
55
59
public:
56
60
 
57
 
  static plugin::Registry& singleton()
 
61
  static Registry& singleton()
58
62
  {
59
 
    static plugin::Registry *registry= new plugin::Registry();
 
63
    static Registry *registry= new Registry();
60
64
    return *registry;
61
65
  }
62
66
 
66
70
 
67
71
  void add(Module *module);
68
72
 
 
73
  void remove(Module *module);
69
74
 
70
75
  std::vector<Module *> getList(bool active);
71
76
 
72
 
  const std::map<std::string, Plugin *> &getPluginsMap() const
 
77
  const std::map<std::string, plugin::Plugin *> &getPluginsMap() const
73
78
  {
74
79
    return plugin_registry;
75
80
  }
79
84
    return module_map;
80
85
  }
81
86
 
82
 
  Library *addLibrary(const std::string &plugin_name);
 
87
  Library *addLibrary(const std::string &plugin_name, bool builtin= false);
83
88
  void removeLibrary(const std::string &plugin_name);
84
89
  Library *findLibrary(const std::string &plugin_name) const;
85
90
 
 
91
  void shutdownModules();
 
92
 
86
93
  template<class T>
87
94
  void add(T *plugin)
88
95
  {
106
113
                    plugin->getName().c_str());
107
114
      unireg_abort(1);
108
115
    }
109
 
    plugin_registry.insert(std::pair<std::string, Plugin *>(plugin_name, plugin));
 
116
    plugin_registry.insert(std::pair<std::string, plugin::Plugin *>(plugin_name, plugin));
110
117
  }
111
118
 
112
119
  template<class T>
122
129
 
123
130
};
124
131
 
125
 
} /* end namespace plugin */
126
 
} /* end namespace drizzled */
127
 
#endif /* DRIZZLED_PLUGIN_REGISTRY_H */
 
132
} /* namespace module */
 
133
} /* namespace drizzled */
 
134
#endif /* DRIZZLED_MODULE_REGISTRY_H */