~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/plugin.h

  • Committer: Brian Aker
  • Date: 2010-08-18 19:37:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1720.
  • Revision ID: brian@tangent.org-20100818193719-bxxzn1pi22styowd
created function that can be used to simply crash the server.

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
 
  /*
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
52
  void activate()
70
53
  {
71
 
    _is_active= true;
 
54
    is_active= true;
72
55
  }
73
56
 
74
57
  void deactivate()
75
58
  {
76
 
    _is_active= false;
 
59
    is_active= false;
77
60
  }
78
61
 
79
62
  bool isActive() const
80
63
  {
81
 
    return _is_active;
 
64
    return is_active;
82
65
  }
83
66
 
84
67
  const std::string &getName() const
85
68
  {
86
 
    return _name;
 
69
    return name;
87
70
  } 
88
71
 
89
 
  void setModule(module::Module *module)
 
72
  void setModule(module::Module *module_arg)
90
73
  {
91
 
    _module= module;
 
74
    module= module_arg;
92
75
  }
93
76
 
94
77
  const std::string& getTypeName() const
95
78
  {
96
 
    return _type_name;
 
79
    return type_name;
97
80
  }
98
81
 
99
82
  const std::string& getModuleName() const;