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 (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.

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 60 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 63 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 346 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 239 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 131 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 527 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 215 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 91 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 357 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 76 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 119 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 260 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 427 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 124 of file PluginManager.h.

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

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 501 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 192 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 161 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 249 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 519 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 665 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 667 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 657 of file PluginManager.h.

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

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 663 of file PluginManager.h.


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


fzi_icl_core
Author(s):
autogenerated on Tue Aug 8 2017 02:28:05