~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to drizzled/plugin/registry.h

  • Committer: Padraig O'Sullivan
  • Date: 2010-04-17 01:38:47 UTC
  • mfrom: (1237.9.238 bad-staging)
  • Revision ID: osullivan.padraig@gmail.com-20100417013847-ibjioqsfbmf5yg4g
Merge trunk.

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