diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..9f442cb --- /dev/null +++ b/main.cpp | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * main.cpp <PLUGINMANAGER> | ||
3 | * | ||
4 | * Copyright 2009 Max Christian Pohle <coderz@gmx.de> | ||
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; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
19 | * MA 02110-1301, USA. | ||
20 | */ | ||
21 | |||
22 | #include <iostream> | ||
23 | #include "pluginmanager.hpp" | ||
24 | |||
25 | using namespace std; | ||
26 | int main(int argc, char* argv[]) | ||
27 | { | ||
28 | typedef Plugin* create(); | ||
29 | string plugin = string(argv[1]); | ||
30 | try | ||
31 | { | ||
32 | PluginManager<Plugin*> *pm = new PluginManager<Plugin*>(); | ||
33 | pm->load_plugin(plugin); | ||
34 | Plugin* p = pm->get_instance(plugin); | ||
35 | cout << "> VERSION: " << p->get_version() << endl << endl; | ||
36 | p->dosomething(); | ||
37 | } | ||
38 | catch(char* e) | ||
39 | { cout << e << endl; } | ||
40 | } | ||