~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/module.h

Added the testsuite location finding code to support in-plugin-dir test suites.

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_MODULE_MODULE_H
21
 
#define DRIZZLED_MODULE_MODULE_H
22
 
 
23
 
/**
24
 
 * @file Defines a Plugin Module
25
 
 *
26
 
 * A plugin::Module is the fundamental functional element of the plugin system.
27
 
 * Plugins are inited and deinited by module. A module init can register one
28
 
 * or more plugin::Plugin objects. 
29
 
 */
30
 
 
31
 
#include <cassert>
32
 
#include <vector>
33
 
#include <boost/program_options.hpp>
34
 
 
35
 
#include "drizzled/module/manifest.h"
36
 
#include "drizzled/module/registry.h"
37
 
 
 
20
#ifndef DRIZZLED_PLUGIN_MODULE_H
 
21
#define DRIZZLED_PLUGIN_MODULE_H
 
22
 
 
23
#include <drizzled/lex_string.h>
 
24
#include <mysys/my_alloc.h>
 
25
#include "drizzled/plugin/manifest.h"
 
26
 
 
27
class sys_var;
38
28
 
39
29
namespace drizzled
40
30
{
41
 
class set_var;
42
 
 
43
 
void module_shutdown(module::Registry &registry);
44
 
 
45
 
namespace module
 
31
namespace plugin
46
32
{
47
33
 
48
34
class Library;
51
37
class Module
52
38
{
53
39
  const std::string name;
54
 
  const Manifest *manifest;
55
 
 
 
40
  Manifest *manifest;
56
41
public:
57
 
  typedef std::vector<sys_var *> Variables;
58
42
  Library *plugin_dl;
59
43
  bool isInited;
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
 
 
 
44
  MEM_ROOT mem_root;            /* memory for dynamic plugin structures */
 
45
  sys_var *system_vars;         /* server variables for this plugin */
 
46
  Module(Manifest *manifest_arg, Library *library_arg)
 
47
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(library_arg),
 
48
      isInited(false),
 
49
      mem_root(), system_vars(NULL) {}
 
50
      
 
51
  Module(Manifest *manifest_arg)
 
52
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(NULL),
 
53
      isInited(false),
 
54
      mem_root(), system_vars(NULL) {}
 
55
      
76
56
  const std::string& getName() const
77
57
  {
78
58
    return name;
82
62
  {
83
63
    return *manifest;
84
64
  }
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
 
  }
101
65
};
102
66
 
103
 
} /* namespace module */
 
67
} /* namespace plugin */
104
68
} /* namespace drizzled */
105
69
 
106
 
#endif /* DRIZZLED_MODULE_MODULE_H */
 
70
#endif /* DRIZZLED_PLUGIN_MODULE_H */