~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/plugin.h

  • Committer: Padraig O'Sullivan
  • Date: 2010-02-11 16:22:34 UTC
  • mto: (1300.3.1 query-as-string)
  • mto: This revision was merged to the branch mainline in revision 1307.
  • Revision ID: osullivan.padraig@gmail.com-20100211162234-tkk64v4vdqkb9syv
Removed the found_semicolon member from the parsing stage

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
{
29
 
namespace module
 
28
namespace plugin
30
29
{
 
30
 
31
31
class Module;
32
 
}
33
 
 
34
 
namespace plugin
35
 
{
36
32
 
37
33
class Plugin
38
34
{
39
35
private:
40
 
  const std::string _name;
41
 
  bool _is_active;
42
 
  module::Module *_module;
43
 
  const std::string _type_name;
 
36
  const std::string name;
 
37
  bool is_active;
 
38
  Module *module;
 
39
  const std::string type_name;
44
40
 
45
41
  Plugin();
46
42
  Plugin(const Plugin&);
47
43
  Plugin& operator=(const Plugin &);
48
44
public:
49
 
  typedef std::map<std::string, Plugin *> map;
50
 
  typedef std::vector<Plugin *> vector;
51
45
 
52
 
  explicit Plugin(const std::string &name, const std::string &type_name);
 
46
  explicit Plugin(std::string in_name, std::string in_type_name);
53
47
  virtual ~Plugin() {}
54
48
 
55
 
  /*
56
 
   * This method is called for all plug-ins on shutdown,
57
 
   * _before_ the plug-ins are deleted. It can be used
58
 
   * when shutdown code references other plug-ins.
59
 
   */
60
 
  virtual void shutdownPlugin()
61
 
  {
62
 
  }
63
 
 
64
 
  // This is run after all plugins have been initialized.
65
 
  virtual void prime()
66
 
  {
67
 
  }
68
 
 
69
49
  void activate()
70
50
  {
71
 
    _is_active= true;
 
51
    is_active= true;
72
52
  }
73
53
 
74
54
  void deactivate()
75
55
  {
76
 
    _is_active= false;
 
56
    is_active= false;
77
57
  }
78
58
 
79
59
  bool isActive() const
80
60
  {
81
 
    return _is_active;
 
61
    return is_active;
82
62
  }
83
63
 
84
64
  const std::string &getName() const
85
65
  {
86
 
    return _name;
 
66
    return name;
87
67
  } 
88
68
 
89
 
  void setModule(module::Module *module)
 
69
  void setModule(Module *module_arg)
90
70
  {
91
 
    _module= module;
 
71
    module= module_arg;
92
72
  }
93
73
 
94
74
  const std::string& getTypeName() const
95
75
  {
96
 
    return _type_name;
 
76
    return type_name;
97
77
  }
98
78
 
99
79
  const std::string& getModuleName() const;