Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
icl_core::plugin::PluginManager< T, plugin_dir > Class Template Reference

#include <PluginManager.h>

Inheritance diagram for icl_core::plugin::PluginManager< T, plugin_dir >:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

template<class T, const char *const plugin_dir>
class icl_core::plugin::PluginManager< T, plugin_dir >

Singleton responsible for loading tControlWidget plugins.

Definition at line 57 of file PluginManager.h.


Constructor & Destructor Documentation

template<class T, const char *const plugin_dir>
icl_core::plugin::PluginManager< T, plugin_dir >::~PluginManager ( ) [inline]

Definition at line 60 of file PluginManager.h.

template<class T, const char *const plugin_dir>
icl_core::plugin::PluginManager< T, plugin_dir >::PluginManager ( ) [inline, protected]

Protected default constructor.

Definition at line 344 of file PluginManager.h.


Member Function Documentation

template<class T, const char *const plugin_dir>
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.

See also:
removeStaticPlugin
Note:
Prior to deleting the plugin instance you must call removeStaticPlugin().

Definition at line 237 of file PluginManager.h.

template<class T, const char *const plugin_dir>
std::list<std::string> icl_core::plugin::PluginManager< T, plugin_dir >::availablePlugins ( ) [inline]
Returns:
All plugin identifiers currently available.

Definition at line 129 of file PluginManager.h.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
static PluginManager<T, plugin_dir>* icl_core::plugin::PluginManager< T, plugin_dir >::instance ( ) [inline, static]

Singleton instance accessor.

Singleton instance.

Definition at line 74 of file PluginManager.h.

template<class T, const char *const plugin_dir>
bool icl_core::plugin::PluginManager< T, plugin_dir >::isInitialized ( ) const [inline]

Definition at line 117 of file PluginManager.h.

template<class T, const char *const plugin_dir>
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.

See also:
addStaticPlugin removeStaticPlugin

Definition at line 258 of file PluginManager.h.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
bool icl_core::plugin::PluginManager< T, plugin_dir >::loadLazy ( ) const [inline]

Definition at line 122 of file PluginManager.h.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
T* icl_core::plugin::PluginManager< T, plugin_dir >::plugin ( const std::string &  identifier) [inline]

Return the plugin with the given name.

Parameters:
identifierPlugin name

Definition at line 190 of file PluginManager.h.

template<class T, const char *const plugin_dir>
std::list<T*> icl_core::plugin::PluginManager< T, plugin_dir >::plugins ( ) [inline]
Returns:
All plugins currently instantiated.

Definition at line 159 of file PluginManager.h.

template<class T, const char *const plugin_dir>
void icl_core::plugin::PluginManager< T, plugin_dir >::removeStaticPlugin ( const std::string &  identifier) [inline]

Remove a plugin that was added via addStaticPlugin.

See also:
addStaticPlugin

Definition at line 247 of file PluginManager.h.

template<class T, const char *const plugin_dir>
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.


Member Data Documentation

template<class T, const char *const plugin_dir>
bool icl_core::plugin::PluginManager< T, plugin_dir >::m_initialized [protected]

Definition at line 657 of file PluginManager.h.

template<class T, const char *const plugin_dir>
bool icl_core::plugin::PluginManager< T, plugin_dir >::m_lazy_loading [protected]

Definition at line 659 of file PluginManager.h.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
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.

template<class T, const char *const plugin_dir>
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.


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


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Fri Aug 28 2015 12:59:20