~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/registry.h

  • Committer: Brian Aker
  • Date: 2011-01-13 06:00:40 UTC
  • mfrom: (2069.4.6 clean)
  • mto: This revision was merged to the branch mainline in revision 2078.
  • Revision ID: brian@gir-3-20110113060040-fz7r6c7t39mwt9tz
Merge in change to POTFILES

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <vector>
25
25
#include <map>
26
26
#include <algorithm>
27
 
#include <iostream>
28
 
 
29
 
#include <boost/scoped_ptr.hpp>
30
 
 
31
 
#include <drizzled/gettext.h>
32
 
#include <drizzled/unireg.h>
33
 
#include <drizzled/errmsg_print.h>
34
 
#include <drizzled/plugin/plugin.h>
35
 
 
 
27
 
 
28
#include "drizzled/gettext.h"
 
29
#include "drizzled/unireg.h"
 
30
#include "drizzled/errmsg_print.h"
 
31
#include "drizzled/plugin/plugin.h"
36
32
 
37
33
namespace drizzled
38
34
{
41
37
{
42
38
class Module;
43
39
class Library;
44
 
class Graph;
45
 
 
46
40
 
47
41
class Registry
48
42
{
49
43
public:
50
 
 
51
44
  typedef std::map<std::string, Library *> LibraryMap;
52
45
  typedef std::map<std::string, Module *> ModuleMap;
53
 
  typedef std::vector<Module *> ModuleList;
54
46
private:
55
47
  LibraryMap library_registry_;
56
48
  ModuleMap module_registry_;
57
 
  boost::scoped_ptr<Graph> depend_graph_; 
58
49
  
59
50
  plugin::Plugin::map plugin_registry;
60
51
 
61
 
  bool deps_built_;
 
52
  Registry()
 
53
   : module_registry_(),
 
54
     plugin_registry()
 
55
  { }
62
56
 
63
 
  Registry();
64
57
  Registry(const Registry&);
65
58
  Registry& operator=(const Registry&);
66
59
  ~Registry();
67
 
 
68
 
  void buildDeps();
69
60
public:
70
61
 
71
62
  static Registry& singleton()
84
75
 
85
76
  void remove(Module *module);
86
77
 
87
 
  std::vector<Module *> getList();
 
78
  std::vector<Module *> getList(bool active);
88
79
 
89
80
  const plugin::Plugin::map &getPluginsMap() const
90
81
  {
114
105
                   plugin_name.begin(), ::tolower);
115
106
    if (plugin_registry.find(std::make_pair(plugin_type, plugin_name)) != plugin_registry.end())
116
107
    {
117
 
      errmsg_printf(error::ERROR,
 
108
      errmsg_printf(ERRMSG_LVL_ERROR,
118
109
                    _("Loading plugin %s failed: a %s plugin by that name "
119
110
                      "already exists.\n"),
120
111
                    plugin->getTypeName().c_str(),
128
119
 
129
120
    if (failed)
130
121
    {
131
 
      errmsg_printf(error::ERROR,
 
122
      errmsg_printf(ERRMSG_LVL_ERROR,
132
123
                    _("Fatal error: Failed initializing %s::%s plugin.\n"),
133
124
                    plugin->getTypeName().c_str(),
134
125
                    plugin->getName().c_str());