Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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.
 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.
- Public Member Functions inherited from fawkes::SignalHandler
virtual ~SignalHandler ()
 Virtual destructor.
- Public Member Functions inherited from fawkes::FawkesNetworkClientHandler
virtual ~FawkesNetworkClientHandler ()
 Empty virtual destructor.
virtual void deregistered (unsigned int id)=0 throw ()
 This handler has been deregistered.
virtual void inbound_received (FawkesNetworkMessage *m, unsigned int id)=0 throw ()
 Called for incoming messages.
virtual void connection_died (unsigned int id)=0 throw ()
 Client connection died.
virtual void connection_established (unsigned int id)=0 throw ()
 Client has established a connection.

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
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::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 ( )

Destructor.

Definition at line 92 of file plugin_tool.cpp.

Member Function Documentation

void PluginTool::handle_signal ( int  signum)
virtual

Handle signals.

Parameters
signumsignal number of received signal

Implements fawkes::SignalHandler.

Definition at line 165 of file plugin_tool.cpp.

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

Print usage.

Parameters
program_nameprogram name

Definition at line 101 of file plugin_tool.cpp.

void PluginTool::run ( )

Run opmode as requested determined by the arguments.

Definition at line 393 of file plugin_tool.cpp.

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.

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.

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.

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: