~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/plugin/plugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

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