1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems, Inc.
4
* Copyright (C) 2009 Sun Microsystems
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_MODULE_MODULE_H
21
#define DRIZZLED_MODULE_MODULE_H
24
* @file Defines a Plugin Module
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.
33
#include <boost/program_options.hpp>
35
#include "drizzled/module/manifest.h"
36
#include "drizzled/module/registry.h"
20
#ifndef DRIZZLED_PLUGIN_HANDLE_H
21
#define DRIZZLED_PLUGIN_HANDLE_H
23
#include <drizzled/lex_string.h>
24
#include <mysys/my_alloc.h>
43
void module_shutdown(module::Registry ®istry);
36
/* A handle of a plugin */
55
typedef std::vector<sys_var *> Variables;
56
typedef std::vector<std::string> Depends;
59
39
const std::string name;
60
const Manifest *manifest;
61
VertexHandle *vertex_;
64
42
Library *plugin_dl;
66
Variables system_vars; /* server variables for this plugin */
70
Module(const Manifest *manifest_arg,
71
Library *library_arg);
44
MEM_ROOT mem_root; /* memory for dynamic plugin structures */
45
sys_var *system_vars; /* server variables for this plugin */
46
Handle(Manifest *manifest_arg, Library *library_arg)
47
: name(manifest_arg->name), manifest(manifest_arg), plugin_dl(library_arg),
48
mem_root(), system_vars(NULL) {}
50
Handle(Manifest *manifest_arg)
51
: name(manifest_arg->name), manifest(manifest_arg), plugin_dl(NULL),
52
mem_root(), system_vars(NULL) {}
75
54
const std::string& getName() const
85
void addMySysVar(sys_var *var)
87
sys_vars.push_back(var);
91
void addSysVar(sys_var *var)
93
system_vars.push_back(var);
96
Variables &getSysVars()
101
const Depends &getDepends() const
106
void setVertexHandle(VertexHandle *vertex)
111
VertexHandle *getVertexHandle()
117
} /* namespace module */
65
} /* namespace plugin */
118
66
} /* namespace drizzled */
120
#endif /* DRIZZLED_MODULE_MODULE_H */
68
#endif /* DRIZZLED_PLUGIN_HANDLE_H */