Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

Yehia::PluginManager Class Reference
[Plugin]

PluginManager class. More...

#include <plugin.h>

Inheritance diagram for Yehia::PluginManager:

Yehia::ErrorHandler List of all members.

Public Member Functions

 PluginManager (Ptr< ErrorHandler > parent=0)
 ~PluginManager ()
const std::list< std::string > & arch_indep_paths ()
const std::list< std::string > & arch_dep_paths ()
void register_plugin_loader (PluginLoader &loader)
void unregister_plugin_loader (PluginLoader &loader)
Pluginload_plugin (const std::string &name)
void release_plugin (const std::string &name)
void set_error (const std::string &err=std::string())
const PluginNodeplugins () const
void scan ()
void plugin_found (const std::string &name)

Static Public Member Functions

PluginManager & instance ()

Public Attributes

SigC::Signal1< void, const
std::string & > 
plugin_loaded
SigC::Signal1< void, const
std::string & > 
plugin_unloaded
SigC::Signal1< void, const
std::string & > 
plugin_available
SigC::Signal1< void, const
std::string & > 
plugin_unavailable

Detailed Description

PluginManager class.

The plugin manager is the central component of Yehia. It is responsible for loading plugins using plugin loaders, emitting signals when plugins are loaded and unloaded and for managing scripting languages.


Constructor & Destructor Documentation

Yehia::PluginManager::PluginManager Ptr< ErrorHandler parent = 0  ) 
 

Constructor.

Parameters:
parent The parent errorhandler passed to ErrorHandler::Errorhandler(parent).

Yehia::PluginManager::~PluginManager  ) 
 

Destructor.


Member Function Documentation

const std::list<std::string>& Yehia::PluginManager::arch_dep_paths  ) 
 

Get architecture independant search paths.

Returns:
A list of strings consisting of the directories searched for architecture dependant plugins (e.g. compiled machine code).

const std::list<std::string>& Yehia::PluginManager::arch_indep_paths  ) 
 

Get architecture independant search paths.

Returns:
A list of strings consisting of the directories searched for architecture independant plugins (e.g. scripting plugins).

PluginManager& Yehia::PluginManager::instance  )  [static]
 

Get PluginManager instance.

The PluginManager class is a singleton, that is, only one instance exists in a program.

Returns:
If a PluginManager instance has already been created, this will return a reference to that instance, else a new instance will be created by invoking the constructor with default arguments.

Plugin* Yehia::PluginManager::load_plugin const std::string &  name  ) 
 

Load a plugin.

Parameters:
name Name of the plugin to be loaded.
Returns:
A pointer to the plugin on success, 0 otherwise.

void Yehia::PluginManager::plugin_found const std::string &  name  ) 
 

Indicate a found plugin.

Called by the plugin loaders to tell about available plugins.

const PluginNode& Yehia::PluginManager::plugins  )  const [inline]
 

Get tree of plugins.

Returns:
The root node of the plugin tree.

void Yehia::PluginManager::register_plugin_loader PluginLoader loader  ) 
 

Register a new plugin loader.

Parameters:
loader The loader's load method will be invoked whenever a new plugin should be loaded.

void Yehia::PluginManager::release_plugin const std::string &  name  ) 
 

Relase a plugin.

Free storage asocciated with the plugin.

Parameters:
name Name of the plugin to release.

void Yehia::PluginManager::scan  ) 
 

Scan for plugins.

This invokes PluginLoader::scan(this) for all registered plugin loaders, which in turn invoke PluginManager::plugin_found(name) for all plugins found.

void Yehia::PluginManager::set_error const std::string &  err = std::string()  ) 
 

Set error.

This is invoked with an error message from plugin loaders when they fail. If all loaders registered fail, the last error message provided to set_error will be emitted via ErrorHandler::emit_error(msg).

Parameters:
err Error message.

void Yehia::PluginManager::unregister_plugin_loader PluginLoader loader  ) 
 

Unregister a plugin loader.

Parameters:
loader The loader to be removed from the list of registered plugin loaders.


Member Data Documentation

SigC::Signal1<void, const std::string&> Yehia::PluginManager::plugin_available
 

Emitted when a new plugin becomes available for loading.

Parameters:
id The name of the plugin.

SigC::Signal1<void, const std::string&> Yehia::PluginManager::plugin_loaded
 

Emitted when a plugin is loaded.

Parameters:
id The name of the plugin.

SigC::Signal1<void, const std::string&> Yehia::PluginManager::plugin_unavailable
 

Emitted when a plugin becomes unavailable.

Parameters:
id The name of the plugin.

SigC::Signal1<void, const std::string&> Yehia::PluginManager::plugin_unloaded
 

Emitted when a plugin is unloaded.

Parameters:
id The name of the plugin.


The documentation for this class was generated from the following file:
Generated on Thu May 1 21:13:04 2003 for Yehia by doxygen1.3