~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/module.h

  • Committer: Brian Aker
  • Date: 2010-04-05 23:46:43 UTC
  • Revision ID: brian@gaz-20100405234643-0he3xnj902rc70r8
Fixing tests to work with PBXT.

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_HANDLE_H
21
 
#define DRIZZLED_PLUGIN_HANDLE_H
22
 
 
23
 
#include <drizzled/lex_string.h>
24
 
#include <mysys/my_alloc.h>
25
 
 
 
20
#ifndef DRIZZLED_PLUGIN_MODULE_H
 
21
#define DRIZZLED_PLUGIN_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
 
 
33
#include "drizzled/plugin/manifest.h"
 
34
 
 
35
namespace drizzled
 
36
{
26
37
class sys_var;
27
38
 
28
 
namespace drizzled
29
 
{
30
39
namespace plugin
31
40
{
32
41
 
33
 
class Manifest;
34
42
class Library;
35
43
 
36
 
/* A handle of a plugin */
37
 
class Handle
 
44
/* A plugin module */
 
45
class Module
38
46
{
39
47
  const std::string name;
40
 
  Manifest *manifest;
 
48
  const Manifest *manifest;
41
49
public:
42
50
  Library *plugin_dl;
43
51
  bool isInited;
44
 
  MEM_ROOT mem_root;            /* memory for dynamic plugin structures */
45
52
  sys_var *system_vars;         /* server variables for this plugin */
46
 
  Handle(Manifest *manifest_arg, Library *library_arg)
 
53
  Module(const Manifest *manifest_arg, Library *library_arg)
47
54
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(library_arg),
48
 
      mem_root(), system_vars(NULL) {}
 
55
      isInited(false),
 
56
      system_vars(NULL)
 
57
  {
 
58
    assert(manifest != NULL);
 
59
  }
49
60
      
50
 
  Handle(Manifest *manifest_arg)
 
61
  Module(const Manifest *manifest_arg)
51
62
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(NULL),
52
 
      mem_root(), system_vars(NULL) {}
 
63
      isInited(false),
 
64
      system_vars(NULL)
 
65
  {
 
66
    assert(manifest != NULL);
 
67
  }
53
68
      
54
69
  const std::string& getName() const
55
70
  {
65
80
} /* namespace plugin */
66
81
} /* namespace drizzled */
67
82
 
68
 
#endif /* DRIZZLED_PLUGIN_HANDLE_H */
 
83
#endif /* DRIZZLED_PLUGIN_MODULE_H */