~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/module.h

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

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, Inc.
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 <vector>
33
 
#include <boost/program_options.hpp>
34
 
 
35
 
#include "drizzled/module/manifest.h"
36
 
#include "drizzled/module/registry.h"
37
 
 
38
 
 
39
 
namespace drizzled
40
 
{
41
 
class set_var;
42
 
 
43
 
void module_shutdown(module::Registry &registry);
44
 
 
45
 
namespace module
46
 
{
47
 
 
48
 
class Library;
49
 
class VertexHandle;
50
 
 
51
 
/* A plugin module */
52
 
class Module
53
 
{
54
 
public:
55
 
  typedef std::vector<sys_var *> Variables;
56
 
  typedef std::vector<std::string> Depends;
57
 
 
58
 
private:
59
 
  const std::string name;
60
 
  const Manifest *manifest;
61
 
  VertexHandle *vertex_;
62
 
 
63
 
public:
64
 
  Library *plugin_dl;
65
 
  bool isInited;
66
 
  Variables system_vars;         /* server variables for this plugin */
67
 
  Variables sys_vars;
68
 
  Depends depends_;
69
 
 
70
 
  Module(const Manifest *manifest_arg,
71
 
         Library *library_arg);
72
 
 
73
 
  ~Module();
74
 
 
75
 
  const std::string& getName() const
76
 
  {
77
 
    return name;
78
 
  }
79
 
 
80
 
  const Manifest& getManifest() const
81
 
  {
82
 
    return *manifest;
83
 
  }
84
 
 
85
 
  void addMySysVar(sys_var *var)
86
 
  {
87
 
    sys_vars.push_back(var);
88
 
    addSysVar(var);
89
 
  }
90
 
 
91
 
  void addSysVar(sys_var *var)
92
 
  {
93
 
    system_vars.push_back(var);
94
 
  }
95
 
 
96
 
  Variables &getSysVars()
97
 
  {
98
 
    return system_vars;
99
 
  }
100
 
 
101
 
  const Depends &getDepends() const
102
 
  {
103
 
    return depends_;
104
 
  }
105
 
 
106
 
  void setVertexHandle(VertexHandle *vertex)
107
 
  {
108
 
    vertex_= vertex;
109
 
  }
110
 
 
111
 
  VertexHandle *getVertexHandle()
112
 
  {
113
 
    return vertex_;
114
 
  }
115
 
};
116
 
 
117
 
} /* namespace module */
118
 
} /* namespace drizzled */
119
 
 
120
 
#endif /* DRIZZLED_MODULE_MODULE_H */