~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/plugin.h

  • Committer: Monty Taylor
  • Date: 2010-11-25 01:53:19 UTC
  • mto: (1953.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1955.
  • Revision ID: mordred@inaugust.com-20101125015319-ia85msn25uemopgc
Re-enabled -Wformat and then cleaned up the carnage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <string>
24
24
#include <vector>
25
 
#include <map>
26
25
 
27
26
namespace drizzled
28
27
{
37
36
class Plugin
38
37
{
39
38
private:
40
 
  const std::string _name;
41
 
  bool _is_active;
42
 
  module::Module *_module;
43
 
  const std::string _type_name;
 
39
  const std::string name;
 
40
  bool is_active;
 
41
  module::Module *module;
 
42
  const std::string type_name;
44
43
 
45
44
  Plugin();
46
45
  Plugin(const Plugin&);
47
46
  Plugin& operator=(const Plugin &);
48
47
public:
49
 
  typedef std::map<std::string, Plugin *> map;
50
 
  typedef std::vector<Plugin *> vector;
51
48
 
52
 
  explicit Plugin(const std::string &name, const std::string &type_name);
 
49
  explicit Plugin(std::string in_name, std::string in_type_name);
53
50
  virtual ~Plugin() {}
54
51
 
55
52
  /*
60
57
  virtual void shutdownPlugin()
61
58
  {
62
59
  }
63
 
 
64
 
  // This is run after all plugins have been initialized.
65
 
  virtual void prime()
66
 
  {
67
 
  }
68
60
 
69
61
  void activate()
70
62
  {
71
 
    _is_active= true;
 
63
    is_active= true;
72
64
  }
73
65
 
74
66
  void deactivate()
75
67
  {
76
 
    _is_active= false;
 
68
    is_active= false;
77
69
  }
78
70
 
79
71
  bool isActive() const
80
72
  {
81
 
    return _is_active;
 
73
    return is_active;
82
74
  }
83
75
 
84
76
  const std::string &getName() const
85
77
  {
86
 
    return _name;
 
78
    return name;
87
79
  } 
88
80
 
89
 
  void setModule(module::Module *module)
 
81
  void setModule(module::Module *module_arg)
90
82
  {
91
 
    _module= module;
 
83
    module= module_arg;
92
84
  }
93
85
 
94
86
  const std::string& getTypeName() const
95
87
  {
96
 
    return _type_name;
 
88
    return type_name;
97
89
  }
98
90
 
99
91
  const std::string& getModuleName() const;