Fawkes API  Fawkes Development Version
PluginTool Class Reference

Program to communicate with plugin manager via Fawkes network. More...

#include <tools/plugin/plugin_tool.h>

Inheritance diagram for PluginTool:

Public Member Functions

 PluginTool (fawkes::ArgumentParser *argp, fawkes::FawkesNetworkClient *c)
 Constructor. More...
 
 PluginTool (fawkes::FawkesNetworkClient *c)
 Constructor. More...
 
 ~PluginTool ()
 Destructor. More...
 
void handle_signal (int signum)
 Handle signals. More...
 
void set_load_plugin (const char *plugin_name)
 Load plugin on next run. More...
 
void set_unload_plugin (const char *plugin_name)
 Unload plugin on next run. More...
 
void set_watch_mode ()
 Set watch mode. More...
 
void set_list_mode ()
 Set list mode. More...
 
void run ()
 Run opmode as requested determined by the arguments. More...
 
- Public Member Functions inherited from fawkes::SignalHandler
virtual ~SignalHandler ()
 Virtual destructor. More...
 
- Public Member Functions inherited from fawkes::FawkesNetworkClientHandler
virtual ~FawkesNetworkClientHandler ()
 Empty virtual destructor. More...
 

Static Public Member Functions

static void print_usage (const char *program_name)
 Print usage. More...
 

Detailed Description

Program to communicate with plugin manager via Fawkes network.

Definition at line 35 of file plugin_tool.h.

Constructor & Destructor Documentation

◆ PluginTool() [1/2]

PluginTool::PluginTool ( fawkes::ArgumentParser argp,
fawkes::FawkesNetworkClient c 
)

Constructor.

Parameters
argpargument 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
cFawkesNetworkClient 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() [2/2]

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
cFawkes network client with established connection

Definition at line 82 of file plugin_tool.cpp.

◆ ~PluginTool()

PluginTool::~PluginTool ( )

Destructor.

Definition at line 92 of file plugin_tool.cpp.

Member Function Documentation

◆ handle_signal()

◆ print_usage()

void PluginTool::print_usage ( const char *  program_name)
static

Print usage.

Parameters
program_nameprogram name

Definition at line 101 of file plugin_tool.cpp.

◆ run()

void PluginTool::run ( )

Run opmode as requested determined by the arguments.

Definition at line 393 of file plugin_tool.cpp.

◆ set_list_mode()

void PluginTool::set_list_mode ( )

Set list mode.

On next run() call the client will list all loaded plugins once.

Definition at line 155 of file plugin_tool.cpp.

◆ set_load_plugin()

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_namename of the plugin to load

Definition at line 121 of file plugin_tool.cpp.

◆ set_unload_plugin()

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_namename of the plugin to unload

Definition at line 134 of file plugin_tool.cpp.

◆ set_watch_mode()

void PluginTool::set_watch_mode ( )

Set watch mode.

On next run() call the client will watch for new events.

Definition at line 145 of file plugin_tool.cpp.


The documentation for this class was generated from the following files: