~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/module.h

  • Committer: Monty Taylor
  • Date: 2008-12-08 01:15:27 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081208011527-lq9m47jsmiiqn999
Replaced my hacked up m4/ac_system_extensions.m4 with the one from gnulib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
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
 
{
37
 
class sys_var;
38
 
 
39
 
namespace plugin
40
 
{
41
 
 
42
 
class Library;
43
 
 
44
 
/* A plugin module */
45
 
class Module
46
 
{
47
 
  const std::string name;
48
 
  const Manifest *manifest;
49
 
public:
50
 
  Library *plugin_dl;
51
 
  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
 
      
69
 
  const std::string& getName() const
70
 
  {
71
 
    return name;
72
 
  }
73
 
 
74
 
  const Manifest& getManifest() const
75
 
  {
76
 
    return *manifest;
77
 
  }
78
 
};
79
 
 
80
 
} /* namespace plugin */
81
 
} /* namespace drizzled */
82
 
 
83
 
#endif /* DRIZZLED_PLUGIN_MODULE_H */