~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/module.h

  • Committer: Brian Aker
  • Date: 2010-11-08 18:24:58 UTC
  • mto: (1921.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1916.
  • Revision ID: brian@tangent.org-20101108182458-twv4hyix43ojno80
Merge in changes such that lock is now broken out into its own directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_PLUGIN_MODULE_H
21
 
#define DRIZZLED_PLUGIN_MODULE_H
 
20
#ifndef DRIZZLED_MODULE_MODULE_H
 
21
#define DRIZZLED_MODULE_MODULE_H
22
22
 
23
23
/**
24
24
 * @file Defines a Plugin Module
29
29
 */
30
30
 
31
31
#include <cassert>
32
 
 
33
 
#include "drizzled/plugin/manifest.h"
 
32
#include <vector>
 
33
#include <boost/program_options.hpp>
 
34
 
 
35
#include "drizzled/module/manifest.h"
 
36
#include "drizzled/module/registry.h"
 
37
 
34
38
 
35
39
namespace drizzled
36
40
{
37
 
class sys_var;
38
 
 
39
 
namespace plugin
 
41
class set_var;
 
42
 
 
43
void module_shutdown(module::Registry &registry);
 
44
 
 
45
namespace module
40
46
{
41
47
 
42
48
class Library;
46
52
{
47
53
  const std::string name;
48
54
  const Manifest *manifest;
 
55
 
49
56
public:
 
57
  typedef std::vector<sys_var *> Variables;
50
58
  Library *plugin_dl;
51
59
  bool isInited;
52
 
  sys_var *system_vars;         /* server variables for this plugin */
53
 
  Module(const Manifest *manifest_arg, Library *library_arg)
54
 
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(library_arg),
55
 
      isInited(false),
56
 
      system_vars(NULL)
57
 
  {
58
 
    assert(manifest != NULL);
59
 
  }
60
 
      
61
 
  Module(const Manifest *manifest_arg)
62
 
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(NULL),
63
 
      isInited(false),
64
 
      system_vars(NULL)
65
 
  {
66
 
    assert(manifest != NULL);
67
 
  }
68
 
      
 
60
  Variables system_vars;         /* server variables for this plugin */
 
61
  Variables sys_vars;
 
62
  Module(const Manifest *manifest_arg,
 
63
         Library *library_arg) :
 
64
    name(manifest_arg->name),
 
65
    manifest(manifest_arg),
 
66
    plugin_dl(library_arg),
 
67
    isInited(false),
 
68
    system_vars(),
 
69
    sys_vars()
 
70
  {
 
71
    assert(manifest != NULL);
 
72
  }
 
73
 
 
74
  ~Module();
 
75
 
69
76
  const std::string& getName() const
70
77
  {
71
78
    return name;
75
82
  {
76
83
    return *manifest;
77
84
  }
 
85
 
 
86
  void addMySysVar(sys_var *var)
 
87
  {
 
88
    sys_vars.push_back(var);
 
89
    addSysVar(var);
 
90
  }
 
91
 
 
92
  void addSysVar(sys_var *var)
 
93
  {
 
94
    system_vars.push_back(var);
 
95
  }
 
96
 
 
97
  Variables &getSysVars()
 
98
  {
 
99
    return system_vars;
 
100
  }
78
101
};
79
102
 
80
 
} /* namespace plugin */
 
103
} /* namespace module */
81
104
} /* namespace drizzled */
82
105
 
83
 
#endif /* DRIZZLED_PLUGIN_MODULE_H */
 
106
#endif /* DRIZZLED_MODULE_MODULE_H */