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 
28 namespace fawkes {
29 class Logger;
30 class PluginManager;
31 } // namespace fawkes
32 
34 {
35 public:
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 
76 private:
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(fawkes::PluginManager *plugin_manager)
Constructor.
Definition: plugin.cpp:75
XML-RPC method to load a plugin.
Definition: plugin.h:52
Fawkes library namespace.
~XmlRpcPluginMethods()
Destructor.
Definition: plugin.cpp:60
Wrapper class for plugin related XML-RPC methods.
Definition: plugin.h:33
XML-RPC method to unload a plugin.
Definition: plugin.h:64
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:148
Fawkes Plugin Manager.
Definition: manager.h:47
Plugin list XML-RPC method.
Definition: plugin.h:41
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
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: plugin.cpp:94
virtual ~plugin_load()
Virtual empty destructor.
Definition: plugin.cpp:139
plugin_unload(fawkes::PluginManager *plugin_manager, fawkes::Logger *logger)
Constructor.
Definition: plugin.cpp:173
plugin_load(fawkes::PluginManager *plugin_manager, fawkes::Logger *logger)
Constructor.
Definition: plugin.cpp:128
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:41