Public Member Functions

fawkes::PluginManager Class Reference

Fawkes Plugin Manager. More...

#include <>>

Inheritance diagram for fawkes::PluginManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PluginManager (ThreadCollector *thread_collector, Configuration *config, const char *meta_plugin_prefix)
 Constructor.
 ~PluginManager ()
 Destructor.
virtual void config_tag_changed (const char *new_tag)
virtual void config_value_changed (const char *path, bool is_default, int value)
virtual void config_value_changed (const char *path, bool is_default, unsigned int value)
virtual void config_value_changed (const char *path, bool is_default, float value)
virtual void config_value_changed (const char *path, bool is_default, bool value)
virtual void config_value_changed (const char *path, bool is_default, const char *value)
virtual void config_comment_changed (const char *path, bool is_default, const char *comment)
virtual void config_value_erased (const char *path, bool is_default)
virtual void fam_event (const char *filename, unsigned int mask)
 Event has been raised.
void load (const char *plugin_list)
 Load plugin.
void unload (const char *plugin_name)
 Unload plugin.
bool is_loaded (const char *plugin_name)
 Check if plugin is loaded.
std::list< std::string > get_loaded_plugins ()
 Get list of loaded plugins.
std::list< std::pair
< std::string, std::string > > 
get_available_plugins ()
 Generate list of all available plugins.
void add_listener (PluginManagerListener *listener)
 Add listener.
void remove_listener (PluginManagerListener *listener)
 Remove listener.

Detailed Description

Fawkes Plugin Manager.

This class provides a manager for the plugins used in fawkes. It can load and unload modules.

Author:
Tim Niemueller

Definition at line 52 of file manager.h.


Constructor & Destructor Documentation

fawkes::PluginManager::PluginManager ( ThreadCollector thread_collector,
Configuration config,
const char *  meta_plugin_prefix 
)

Constructor.

Parameters:
thread_collector thread manager plugin threads will be added to and removed from appropriately.
config Fawkes configuration
meta_plugin_prefix Path prefix for meta plugins

Definition at line 66 of file manager.cpp.

References fawkes::Configuration::add_change_handler(), and fawkes::LibLogger::log_warn().

fawkes::PluginManager::~PluginManager (  ) 

Member Function Documentation

void fawkes::PluginManager::add_listener ( PluginManagerListener listener  ) 

Add listener.

Listeners are notified of plugin load and unloda events.

Parameters:
listener listener to add

Definition at line 531 of file manager.cpp.

References fawkes::LockList< Type >::lock(), and fawkes::LockList< Type >::unlock().

Referenced by fawkes::PluginNetworkHandler::PluginNetworkHandler().

void fawkes::PluginManager::fam_event ( const char *  filename,
unsigned int  mask 
) [virtual]
std::list< std::pair< std::string, std::string > > fawkes::PluginManager::get_available_plugins (  ) 

Generate list of all available plugins.

Returns:
list of plugins that are available, each plugin is represented by a pair of strings. The first string is the plugin name, the second is its description.

Definition at line 175 of file manager.cpp.

Referenced by XmlRpcPluginMethods::plugin_list::execute(), and WebviewPluginsRequestProcessor::process_request().

std::list< std::string > fawkes::PluginManager::get_loaded_plugins (  ) 

Get list of loaded plugins.

Returns:
list of names of real and meta plugins currently loaded

Definition at line 191 of file manager.cpp.

References fawkes::LockMap< KeyType, ValueType, LessKey >::lock(), and fawkes::LockMap< KeyType, ValueType, LessKey >::unlock().

Referenced by XmlRpcPluginMethods::plugin_list::execute().

bool fawkes::PluginManager::is_loaded ( const char *  plugin_name  ) 

Check if plugin is loaded.

Parameters:
plugin_name plugin to check if it is loaded
Returns:
true if the plugin is currently loaded, false otherwise

Definition at line 215 of file manager.cpp.

References fawkes::PluginLoader::is_loaded().

Referenced by fawkes::PluginNetworkHandler::loop(), and WebviewPluginsRequestProcessor::process_request().

void fawkes::PluginManager::load ( const char *  plugin_list  ) 
void fawkes::PluginManager::remove_listener ( PluginManagerListener listener  ) 

Remove listener.

Parameters:
listener listener to remove

Definition at line 544 of file manager.cpp.

References fawkes::LockList< Type >::remove_locked().

Referenced by fawkes::PluginNetworkHandler::~PluginNetworkHandler().

void fawkes::PluginManager::unload ( const char *  plugin_name  ) 

Unload plugin.

Note that this method does not allow to pass a list of plugins, but it will only accept a single plugin at a time.

Parameters:
plugin_name plugin to unload, can be a meta plugin.

Definition at line 335 of file manager.cpp.

References fawkes::LockMap< KeyType, ValueType, LessKey >::erase_locked(), fawkes::LockMap< KeyType, ValueType, LessKey >::lock(), fawkes::LibLogger::log_error(), fawkes::LibLogger::log_info(), fawkes::ThreadCollector::remove(), fawkes::PluginLoader::unload(), and fawkes::LockMap< KeyType, ValueType, LessKey >::unlock().

Referenced by XmlRpcPluginMethods::plugin_unload::execute(), and WebviewPluginsRequestProcessor::process_request().


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