#include <BasicPluginManager.h>
Collaboration diagram for BasicPluginManager< T >:
Public Types | |
typedef std::list< BasicPluginInfo * > | infos_t |
Public Member Functions | |
BasicPluginManager (bool preloadDeps=false) | |
virtual | ~BasicPluginManager () |
Destruct the plugin manager. | |
virtual void | init (T *plugin) |
Initialization function called when a plugin is first loaded. | |
void | destroyPlugin (std::string pluginName) |
Deallocate a specific plugin. | |
void | unload () |
Deallocate all plugins in the correct order. | |
void | closeLibraries () |
Close all shared library handles. | |
bool | dependsOn (std::string plugin1, std::string plugin2) |
If plugin1 has not yet been registered this function will return false;. | |
T * | get (const std::string pluginName) |
Get a pointer to a named plugin. | |
bool | isLoaded (std::string pluginName) |
True if plugin with name pluginName is loaded. | |
const BasicPluginInfo * | getPluginInfo (const std::string pluginName) |
A reference to the named plugins info structure. | |
infos_t & | getPluginInfos () |
void | loadLibraries (const std::string path) |
Loads all plugin libraries on a ':' separated path list. | |
void | loadLibrary (const std::string filename) |
Load a plugin library. | |
void | registerPlugin (BasicPluginInfo *info, BasicClassFactoryBase< T > *factory) |
Called by BasicPluginProxy to register itself with the manager. | |
void | setPluginException (BasicException e) |
Used by statically allocated plugins to pass any exceptions back to the library loader. | |
Static Public Attributes | |
const char | libExtension [] = ".so" |
May need to ifdef this for windows dlls. | |
Protected Member Functions | |
BasicClassFactoryBase< T > * | getPluginFactory (const std::string pluginName) |
A reference to the named plugin's factory. | |
void | loadSingleLibraryPath (const std::string path) |
Loads all libraries on a single path. | |
Private Types | |
typedef std::map< std::string, BasicClassFactoryBase< T > * > | factories_t |
typedef std::map< std::string, BasicPluginInfo * > | infoMap_t |
typedef std::map< std::string, T * > | plugins_t |
typedef std::map< std::string, lt_dlhandle > | libraryHandles_t |
Private Attributes | |
factories_t | factories |
A map from plugin name to registered factory. | |
infoMap_t | infoMap |
A map from plugin name to registered info. | |
plugins_t | plugins |
A map from plugin name to plugin instance. | |
libraryHandles_t | libraryHandles |
A map of loaded library handles. | |
infos_t | infos |
A list of plugin info structures. | |
BasicException * | pluginException |
Holds exceptions thrown by plugins on dlopen. | |
bool | preloadDeps |
If true dependencies will be loaded first. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Destruct the plugin manager. Deallocates all plugins and closes all plugin libraries. |
|
Close all shared library handles.
|
|
If plugin1 has not yet been registered this function will return false;.
|
|
Deallocate a specific plugin.
|
|
Get a pointer to a named plugin. If an instance has not yet been allocated it will be created. If the plugin name is unknown a BasicException will be thrown.
|
|
A reference to the named plugin's factory.
|
|
A reference to the named plugins info structure.
|
|
|
|
Initialization function called when a plugin is first loaded. Child classes should over load this function for type specific plugin initialization.
|
|
True if plugin with name pluginName is loaded.
|
|
Loads all plugin libraries on a ':' separated path list.
|
|
Load a plugin library.
|
|
Loads all libraries on a single path.
|
|
Called by BasicPluginProxy to register itself with the manager.
|
|
Used by statically allocated plugins to pass any exceptions back to the library loader.
|
|
Deallocate all plugins in the correct order.
|
|
A map from plugin name to registered factory.
|
|
A map from plugin name to registered info.
|
|
A list of plugin info structures.
|
|
May need to ifdef this for windows dlls.
|
|
A map of loaded library handles.
|
|
Holds exceptions thrown by plugins on dlopen.
|
|
A map from plugin name to plugin instance.
|
|
If true dependencies will be loaded first.
|