~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/module.h

Merged from trunk.

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_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 <boost/program_options.hpp>
33
 
 
34
 
#include "drizzled/module/manifest.h"
35
 
#include "drizzled/module/registry.h"
36
 
 
37
 
 
38
 
namespace drizzled
39
 
{
40
 
class sys_var;
41
 
 
42
 
void module_shutdown(module::Registry &registry);
43
 
 
44
 
namespace module
45
 
{
46
 
 
47
 
class Library;
48
 
 
49
 
/* A plugin module */
50
 
class Module
51
 
{
52
 
  const std::string name;
53
 
  const Manifest *manifest;
54
 
 
55
 
public:
56
 
  Library *plugin_dl;
57
 
  bool isInited;
58
 
  sys_var *system_vars;         /* server variables for this plugin */
59
 
  Module(const Manifest *manifest_arg,
60
 
         Library *library_arg) :
61
 
    name(manifest_arg->name),
62
 
    manifest(manifest_arg),
63
 
    plugin_dl(library_arg),
64
 
    isInited(false),
65
 
    system_vars(NULL)
66
 
  {
67
 
    assert(manifest != NULL);
68
 
  }
69
 
      
70
 
  const std::string& getName() const
71
 
  {
72
 
    return name;
73
 
  }
74
 
 
75
 
  const Manifest& getManifest() const
76
 
  {
77
 
    return *manifest;
78
 
  }
79
 
 
80
 
};
81
 
 
82
 
} /* namespace module */
83
 
} /* namespace drizzled */
84
 
 
85
 
#endif /* DRIZZLED_MODULE_MODULE_H */