Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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]

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. More...
 
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 ()
 
- Public Member Functions inherited from icl_core::plugin::PluginManagerBase
void addPluginPath (const std::string &path)
 
StringList errorMessages ()
 
 PluginManagerBase (std::string plugin_dir="")
 
StringList pluginPaths ()
 

Static Public Member Functions

static PluginManager< T, plugin_dir > * instance ()
 Singleton instance accessor. More...
 

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. More...
 
void unloadPlugin (const std::string &identifier)
 
- Protected Member Functions inherited from icl_core::plugin::PluginManagerBase
void addErrorMessage (const std::string &message)
 
void clearErrorMessages ()
 

Protected Attributes

bool m_initialized
 
bool m_lazy_loading
 
std::map< std::string, T * > m_loaded_plugins
 Plugins loaded from disk via ltdl. More...
 
std::map< std::string, PluginHandlem_plugin_handles
 Loadable plugin handles. More...
 
std::map< std::string, T * > m_static_plugins
 Plugins available from an already loaded lib, added manually. More...
 
- Protected Attributes inherited from icl_core::plugin::PluginManagerBase
StringList m_error_messages
 

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 ( )
inlineprotected

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)
inlineprotected

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)
inlineprotected

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 ( )
inlinestatic

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)
inlineprotected

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 
)
inlineprotected

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 ( )
inlineprotected

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)
inlineprotected

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 Mon Jun 10 2019 13:17:59