#include <PluginManager.h>
Public Member Functions | |
void | addStaticPlugin (T *instance) |
std::list< std::string > | availablePlugins () |
T * | createPluginInstance (const std::string &identifier) |
bool | initialize (bool load_lazy=true, bool recursive_search=false) |
Initializes the PluginManager. | |
bool | isInitialized () const |
bool | isStaticPlugin (const std::string &identifier) const |
bool | loadLazy () const |
T * | plugin (const std::string &identifier) |
std::list< T * > | plugins () |
void | removeStaticPlugin (const std::string &identifier) |
~PluginManager () | |
Static Public Member Functions | |
static PluginManager< T, plugin_dir > * | instance () |
Singleton instance accessor. | |
Protected Member Functions | |
void | closePluginHandle (const std::string &identifier) |
void | initializePlugins (bool recursive_search) |
void | loadHandle (std::string plugin) |
T * | loadPluginInstance (PluginHandle plugin_handle, const std::string &identifier) |
void | loadPlugins () |
PluginManager () | |
Protected default constructor. | |
void | unloadPlugin (const std::string &identifier) |
Protected Attributes | |
bool | m_initialized |
bool | m_lazy_loading |
std::map< std::string, T * > | m_loaded_plugins |
Plugins loaded from disk via ltdl. | |
std::map< std::string, PluginHandle > | m_plugin_handles |
Loadable plugin handles. | |
std::map< std::string, T * > | m_static_plugins |
Plugins available from an already loaded lib, added manually. |
Singleton responsible for loading tControlWidget plugins.
Definition at line 60 of file PluginManager.h.
icl_core::plugin::PluginManager< T, plugin_dir >::~PluginManager | ( | ) | [inline] |
Definition at line 63 of file PluginManager.h.
icl_core::plugin::PluginManager< T, plugin_dir >::PluginManager | ( | ) | [inline, protected] |
Protected default constructor.
Definition at line 346 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::addStaticPlugin | ( | T * | instance | ) | [inline] |
Manually add an already created plugin instance. Can be useful for example if the plugin is linked against the program already and does not need to be loaded dynamically. Ownership of the instance retains with the caller of the function.
Definition at line 239 of file PluginManager.h.
std::list<std::string> icl_core::plugin::PluginManager< T, plugin_dir >::availablePlugins | ( | ) | [inline] |
Definition at line 131 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::closePluginHandle | ( | const std::string & | identifier | ) | [inline, protected] |
Closes a Plugin handle with a given identifier.
Definition at line 527 of file PluginManager.h.
T* icl_core::plugin::PluginManager< T, plugin_dir >::createPluginInstance | ( | const std::string & | identifier | ) | [inline] |
Create a new plugin instance. Warning: Manager doesn't care about instantiated object.
Definition at line 215 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::initialize | ( | bool | load_lazy = true , |
bool | recursive_search = false |
||
) | [inline] |
Initializes the PluginManager.
Definition at line 91 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::initializePlugins | ( | bool | recursive_search | ) | [inline, protected] |
Search all files in the specified directories and add plugins found.
Definition at line 357 of file PluginManager.h.
static PluginManager<T, plugin_dir>* icl_core::plugin::PluginManager< T, plugin_dir >::instance | ( | ) | [inline, static] |
bool icl_core::plugin::PluginManager< T, plugin_dir >::isInitialized | ( | ) | const [inline] |
Definition at line 119 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::isStaticPlugin | ( | const std::string & | identifier | ) | const [inline] |
Returns true
if a plugin with the given identifier was added with addStaticPlugin() and not removed afterwards.
Definition at line 260 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::loadHandle | ( | std::string | plugin | ) | [inline, protected] |
Load the plugin handle.
Definition at line 427 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::loadLazy | ( | ) | const [inline] |
Definition at line 124 of file PluginManager.h.
T* icl_core::plugin::PluginManager< T, plugin_dir >::loadPluginInstance | ( | PluginHandle | plugin_handle, |
const std::string & | identifier | ||
) | [inline, protected] |
Creates a new plugin instance.
Definition at line 548 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::loadPlugins | ( | ) | [inline, protected] |
Loads an instance for all available plugins. Manager will take care of these instances.
Definition at line 501 of file PluginManager.h.
T* icl_core::plugin::PluginManager< T, plugin_dir >::plugin | ( | const std::string & | identifier | ) | [inline] |
Return the plugin with the given name.
identifier | Plugin name |
Definition at line 192 of file PluginManager.h.
std::list<T*> icl_core::plugin::PluginManager< T, plugin_dir >::plugins | ( | ) | [inline] |
Definition at line 161 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::removeStaticPlugin | ( | const std::string & | identifier | ) | [inline] |
Remove a plugin that was added via addStaticPlugin.
Definition at line 249 of file PluginManager.h.
void icl_core::plugin::PluginManager< T, plugin_dir >::unloadPlugin | ( | const std::string & | identifier | ) | [inline, protected] |
Unload a Plugin with a given identifier.
Definition at line 519 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::m_initialized [protected] |
Definition at line 665 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::m_lazy_loading [protected] |
Definition at line 667 of file PluginManager.h.
std::map<std::string, T*> icl_core::plugin::PluginManager< T, plugin_dir >::m_loaded_plugins [protected] |
Plugins loaded from disk via ltdl.
Definition at line 657 of file PluginManager.h.
std::map<std::string, PluginHandle> icl_core::plugin::PluginManager< T, plugin_dir >::m_plugin_handles [protected] |
Loadable plugin handles.
Definition at line 660 of file PluginManager.h.
std::map<std::string, T*> icl_core::plugin::PluginManager< T, plugin_dir >::m_static_plugins [protected] |
Plugins available from an already loaded lib, added manually.
Definition at line 663 of file PluginManager.h.