~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/library.h

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

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_LIBRARY_H
21
 
#define DRIZZLED_PLUGIN_LIBRARY_H
22
 
 
23
 
/**
24
 
 * @file Defines a Plugin Library Wrapper
25
 
 *
26
 
 * A plugin::Library is a wrapper object around a plugin .so file. It owns
27
 
 * the void * returned by dlopen and contains the knowledge of how to load
28
 
 * and unload plugin libraries via dlopen().
29
 
 */
30
 
 
31
 
#include <string>
32
 
 
33
 
namespace drizzled
34
 
{
35
 
namespace plugin
36
 
{
37
 
 
38
 
class Manifest;
39
 
 
40
 
/* A handle for the dynamic library containing a plugin or plugins. */
41
 
class Library
42
 
{
43
 
  std::string name;
44
 
  void *handle;
45
 
  const Manifest *manifest;
46
 
 
47
 
  /* We don't want these */
48
 
  Library();
49
 
  Library(const Library &);
50
 
  Library& operator=(const Library &);
51
 
 
52
 
  /* Construction should only happen through the static factory method */
53
 
  Library(const std::string &name_arg,
54
 
          void *handle_arg,
55
 
          const Manifest *manifest_arg);
56
 
public:
57
 
  ~Library();
58
 
 
59
 
  const std::string &getName() const
60
 
  {
61
 
    return name;
62
 
  }
63
 
 
64
 
  const Manifest *getManifest() const
65
 
  {
66
 
    return manifest;
67
 
  }
68
 
 
69
 
  static Library *loadLibrary(const std::string &plugin_name);
70
 
};
71
 
 
72
 
} /* namespace plugin */
73
 
} /* namespace drizzled */
74
 
 
75
 
#endif /* DRIZZLED_PLUGIN_LIBRARY_H */