#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 (lt_dlhandle 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, lt_dlhandle > | 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 57 of file PluginManager.h.
icl_core::plugin::PluginManager< T, plugin_dir >::~PluginManager | ( | ) | [inline] |
Definition at line 60 of file PluginManager.h.
icl_core::plugin::PluginManager< T, plugin_dir >::PluginManager | ( | ) | [inline, protected] |
Protected default constructor.
Definition at line 344 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 237 of file PluginManager.h.
std::list<std::string> icl_core::plugin::PluginManager< T, plugin_dir >::availablePlugins | ( | ) | [inline] |
Definition at line 129 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 519 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 213 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 89 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 355 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 117 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 258 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 425 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::loadLazy | ( | ) | const [inline] |
Definition at line 122 of file PluginManager.h.
T* icl_core::plugin::PluginManager< T, plugin_dir >::loadPluginInstance | ( | lt_dlhandle | plugin_handle, |
const std::string & | identifier | ||
) | [inline, protected] |
Creates a new plugin instance.
Definition at line 540 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 493 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 190 of file PluginManager.h.
std::list<T*> icl_core::plugin::PluginManager< T, plugin_dir >::plugins | ( | ) | [inline] |
Definition at line 159 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 247 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 511 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::m_initialized [protected] |
Definition at line 657 of file PluginManager.h.
bool icl_core::plugin::PluginManager< T, plugin_dir >::m_lazy_loading [protected] |
Definition at line 659 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 649 of file PluginManager.h.
std::map<std::string, lt_dlhandle> icl_core::plugin::PluginManager< T, plugin_dir >::m_plugin_handles [protected] |
Loadable plugin handles.
Definition at line 652 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 655 of file PluginManager.h.