Fawkes API Fawkes Development Version
plugin.h
1
2/***************************************************************************
3 * plugin.h - XML-RPC methods related to plugin management
4 *
5 * Created: Mon Aug 31 00:50:41 2009
6 * Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL file in the doc directory.
21 */
22
23#ifndef _PLUGINS_XMLRPC_METHODS_PLUGIN_H_
24#define _PLUGINS_XMLRPC_METHODS_PLUGIN_H_
25
26#include <xmlrpc-c/registry.hpp>
27
28namespace fawkes {
29class Logger;
30class PluginManager;
31} // namespace fawkes
32
34{
35public:
36 XmlRpcPluginMethods(std::shared_ptr<xmlrpc_c::registry> registry,
37 fawkes::PluginManager * plugin_manager,
38 fawkes::Logger * logger);
40
41 class plugin_list : public xmlrpc_c::method
42 {
43 public:
44 plugin_list(fawkes::PluginManager *plugin_manager);
45 virtual ~plugin_list();
46 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
47
48 private:
49 fawkes::PluginManager *plugin_manager_;
50 };
51
52 class plugin_load : public xmlrpc_c::method
53 {
54 public:
55 plugin_load(fawkes::PluginManager *plugin_manager, fawkes::Logger *logger);
56 virtual ~plugin_load();
57 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
58
59 private:
60 fawkes::PluginManager *plugin_manager_;
61 fawkes::Logger * logger_;
62 };
63
64 class plugin_unload : public xmlrpc_c::method
65 {
66 public:
67 plugin_unload(fawkes::PluginManager *plugin_manager, fawkes::Logger *logger);
68 virtual ~plugin_unload();
69 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
70
71 private:
72 fawkes::PluginManager *plugin_manager_;
73 fawkes::Logger * logger_;
74 };
75
76private:
77 std::shared_ptr<xmlrpc_c::registry> xmlrpc_registry_;
78
79 fawkes::PluginManager * plugin_manager_;
80 fawkes::Logger * logger_;
81 std::unique_ptr<plugin_list> plugin_list_;
82 std::unique_ptr<plugin_load> plugin_load_;
83 std::unique_ptr<plugin_unload> plugin_unload_;
84};
85
86#endif
Plugin list XML-RPC method.
Definition: plugin.h:42
plugin_list(fawkes::PluginManager *plugin_manager)
Constructor.
Definition: plugin.cpp:75
virtual ~plugin_list()
Virtual empty destructor.
Definition: plugin.cpp:85
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: plugin.cpp:94
XML-RPC method to load a plugin.
Definition: plugin.h:53
plugin_load(fawkes::PluginManager *plugin_manager, fawkes::Logger *logger)
Constructor.
Definition: plugin.cpp:128
virtual ~plugin_load()
Virtual empty destructor.
Definition: plugin.cpp:139
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: plugin.cpp:148
XML-RPC method to unload a plugin.
Definition: plugin.h:65
plugin_unload(fawkes::PluginManager *plugin_manager, fawkes::Logger *logger)
Constructor.
Definition: plugin.cpp:173
virtual ~plugin_unload()
Virtual empty destructor.
Definition: plugin.cpp:184
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: plugin.cpp:193
Wrapper class for plugin related XML-RPC methods.
Definition: plugin.h:34
~XmlRpcPluginMethods()
Destructor.
Definition: plugin.cpp:60
XmlRpcPluginMethods(std::shared_ptr< xmlrpc_c::registry > registry, fawkes::PluginManager *plugin_manager, fawkes::Logger *logger)
Constructor.
Definition: plugin.cpp:44
Interface for logging.
Definition: logger.h:42
Fawkes Plugin Manager.
Definition: manager.h:48
Fawkes library namespace.