1093.3.3
by Monty Taylor
Split out handle and library. |
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 |
||
1530.2.5
by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant |
20 |
#ifndef DRIZZLED_MODULE_LIBRARY_H
|
21 |
#define DRIZZLED_MODULE_LIBRARY_H
|
|
1093.3.3
by Monty Taylor
Split out handle and library. |
22 |
|
1324.2.8
by Monty Taylor
Added some comment headers. |
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 |
||
1228.1.3
by Monty Taylor
All of the outstanding plugin loader system cleanups: |
31 |
#include <string> |
1093.3.3
by Monty Taylor
Split out handle and library. |
32 |
|
1813.2.7
by Monty Taylor
Migrated plugin_dir to fs::path. |
33 |
#include <boost/filesystem.hpp> |
34 |
||
1093.3.3
by Monty Taylor
Split out handle and library. |
35 |
namespace drizzled |
36 |
{
|
|
1530.2.5
by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant |
37 |
namespace module |
1093.3.3
by Monty Taylor
Split out handle and library. |
38 |
{
|
39 |
||
1891.2.1
by Monty Taylor
Fixed things to make things compile with clang |
40 |
struct Manifest; |
1093.3.3
by Monty Taylor
Split out handle and library. |
41 |
|
42 |
/* A handle for the dynamic library containing a plugin or plugins. */
|
|
43 |
class Library |
|
44 |
{
|
|
1228.1.3
by Monty Taylor
All of the outstanding plugin loader system cleanups: |
45 |
std::string name; |
46 |
void *handle; |
|
47 |
const Manifest *manifest; |
|
48 |
||
49 |
/* We don't want these */
|
|
50 |
Library(); |
|
51 |
Library(const Library &); |
|
52 |
Library& operator=(const Library &); |
|
53 |
||
54 |
/* Construction should only happen through the static factory method */
|
|
55 |
Library(const std::string &name_arg, |
|
56 |
void *handle_arg, |
|
57 |
const Manifest *manifest_arg); |
|
1530.2.3
by Monty Taylor
Changed the builtin plugin code path to work exactly the same as dynamic. |
58 |
|
1093.3.3
by Monty Taylor
Split out handle and library. |
59 |
public: |
1228.1.3
by Monty Taylor
All of the outstanding plugin loader system cleanups: |
60 |
~Library(); |
61 |
||
62 |
const std::string &getName() const |
|
63 |
{
|
|
64 |
return name; |
|
65 |
}
|
|
66 |
||
67 |
const Manifest *getManifest() const |
|
68 |
{
|
|
69 |
return manifest; |
|
70 |
}
|
|
71 |
||
1813.2.7
by Monty Taylor
Migrated plugin_dir to fs::path. |
72 |
static const boost::filesystem::path getLibraryPath(const std::string &plugin_name); |
1530.2.3
by Monty Taylor
Changed the builtin plugin code path to work exactly the same as dynamic. |
73 |
static Library *loadLibrary(const std::string &plugin_name, bool builtin); |
1093.3.3
by Monty Taylor
Split out handle and library. |
74 |
};
|
75 |
||
1530.2.5
by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant |
76 |
} /* namespace module */ |
1093.3.3
by Monty Taylor
Split out handle and library. |
77 |
} /* namespace drizzled */ |
78 |
||
1530.2.5
by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant |
79 |
#endif /* DRIZZLED_MODULE_LIBRARY_H */ |