PluginTool Class Reference
Program to communicate with plugin manager via Fawkes network. More...
#include <tools/plugin/plugin_tool.h>

Public Member Functions | |
| PluginTool (fawkes::ArgumentParser *argp, fawkes::FawkesNetworkClient *c) | |
| Constructor. | |
| PluginTool (fawkes::FawkesNetworkClient *c) | |
| Constructor. | |
| ~PluginTool () | |
| Destructor. | |
| void | handle_signal (int signum) |
| Handle signals. | |
| void | set_load_plugin (const char *plugin_name) |
| Load plugin on next run. | |
| void | set_unload_plugin (const char *plugin_name) |
| Unload plugin on next run. | |
| void | set_watch_mode () |
| Set watch mode. | |
| void | set_list_mode () |
| Set list mode. | |
| void | run () |
| Run opmode as requested determined by the arguments. | |
Static Public Member Functions | |
| static void | print_usage (const char *program_name) |
| Print usage. | |
Detailed Description
Program to communicate with plugin manager via Fawkes network.Definition at line 35 of file plugin_tool.h.
Constructor & Destructor Documentation
| PluginTool::PluginTool | ( | fawkes::ArgumentParser * | argp, | |
| fawkes::FawkesNetworkClient * | c | |||
| ) |
Constructor.
- Parameters:
-
argp argument parser, three arguments are handled: - -l plugin_name load plugin named plugin_name
- -u plugin_name unload plugin named plugin_name
- -w watch for changes
c FawkesNetworkClient with established connection
Definition at line 47 of file plugin_tool.cpp.
References fawkes::ArgumentParser::arg(), fawkes::ArgumentParser::has_arg(), and fawkes::ArgumentParser::program_name().
| PluginTool::PluginTool | ( | fawkes::FawkesNetworkClient * | c | ) |
Constructor.
This constructor just set the Fawkes network client. A run() call will fail if not one of set_load_plugin(), set_unload_plugin(), set_watch_mode() or set_list_mode() has been called before.
- Parameters:
-
c Fawkes network client with established connection
Definition at line 82 of file plugin_tool.cpp.
| PluginTool::~PluginTool | ( | ) |
Member Function Documentation
| void PluginTool::handle_signal | ( | int | signum | ) | [virtual] |
Handle signals.
- Parameters:
-
signum signal number of received signal
Implements fawkes::SignalHandler.
Definition at line 163 of file plugin_tool.cpp.
References fawkes::FawkesNetworkClient::wake().
| void PluginTool::print_usage | ( | const char * | program_name | ) | [static] |
Print usage.
- Parameters:
-
program_name program name
Definition at line 101 of file plugin_tool.cpp.
Referenced by run().
| void PluginTool::run | ( | ) |
Run opmode as requested determined by the arguments.
Definition at line 397 of file plugin_tool.cpp.
References fawkes::FawkesNetworkClient::deregister_handler(), print_usage(), and fawkes::FawkesNetworkClient::register_handler().
| void PluginTool::set_list_mode | ( | ) |
Set list mode.
On next run() call the client will list all loaded plugins once.
Definition at line 153 of file plugin_tool.cpp.
| void PluginTool::set_load_plugin | ( | const char * | plugin_name | ) |
Load plugin on next run.
The next time run is called a LOAD_PLUGIN message is sent for the given plugin name.
- Parameters:
-
plugin_name name of the plugin to load
Definition at line 119 of file plugin_tool.cpp.
| void PluginTool::set_unload_plugin | ( | const char * | plugin_name | ) |
Unload plugin on next run.
The next time run is called a UNLOAD_PLUGIN message is sent for the given plugin name.
- Parameters:
-
plugin_name name of the plugin to unload
Definition at line 132 of file plugin_tool.cpp.
| void PluginTool::set_watch_mode | ( | ) |
Set watch mode.
On next run() call the client will watch for new events.
Definition at line 143 of file plugin_tool.cpp.
The documentation for this class was generated from the following files:
- src/tools/plugin/plugin_tool.h
- src/tools/plugin/plugin_tool.cpp

