#include <PluginManager.h>
Public Types | |
| typedef std::vector< Plugin * > | PluginList |
| A listing of plugins loaded by the system. | |
Public Member Functions | |
| ~PluginManager () | |
| Plugin *const | loadPlugin (boost::filesystem::path const path) |
| Loads a plugin into the system if it is not already loaded. | |
| bool const | unloadPlugin (boost::filesystem::path const path) |
| Unloads a plugin from the system. | |
| bool const | reloadPlugin (boost::filesystem::path const path) |
| reloads a plugin into the system. | |
| bool | unloadAllPlugins () |
| Unloads all of the plugins from the system. | |
| void | reloadAllPlugins () |
| Reloads all of the plugins in the system. | |
| PluginList const | getLoadedPlugins () const |
| Retrieves a list of currently loaded plugins. | |
Static Public Attributes | |
| static std::string const | PLUGIN_INIT_FUNC_NAME |
| static std::string const | PLUGIN_DESTROY_FUNC_NAME |
This class can be used to load in plugins (shared libraries) in a platform-independent way. When a plugin is loaded, its path is converted into an operating-specific native string before looking in the filesystem for the plugin.
| typedef std::vector<Plugin*> PWToolBox::PluginManager::PluginList |
A listing of plugins loaded by the system.
| PWToolBox::PluginManager::~PluginManager | ( | ) |
| Plugin* const PWToolBox::PluginManager::loadPlugin | ( | boost::filesystem::path const | path | ) |
Loads a plugin into the system if it is not already loaded.
Calling this on a plugin already loaded returns the plugin.
| path | The path of the plugin. This can be an existing boost::path or implicitly created from a string. |
| SharedLibraryException | Thrown when the plugin couldn't be initialized or the PLUGIN_INIT_FUNC_NAME symbol is not found. |
| bool const PWToolBox::PluginManager::unloadPlugin | ( | boost::filesystem::path const | path | ) |
Unloads a plugin from the system.
This does nothing if the plugin doesn't exist.
| path | The path of the plugin. This can be an existing boost::path or implicitly created from a string. |
| bool const PWToolBox::PluginManager::reloadPlugin | ( | boost::filesystem::path const | path | ) |
reloads a plugin into the system.
This does nothing if the plugin doesn't exist. It may be helpful to reload a plugin into a currently running application if the plugin has updated but the application cannot be forced to shut down.
| path | The path of the plugin. This can be an existing boost::path or implicitly created from a string. |
| SharedLibraryException | Thrown the PLUGIN_DESTROY_FUNC_NAME or PLUGIN_INIT_FUNC_NAME symbol is not found or the plugin could not be initialized. |
| bool PWToolBox::PluginManager::unloadAllPlugins | ( | ) |
Unloads all of the plugins from the system.
This function is called by the destructor, so you don't need to call this function directly when cleaning up.
| void PWToolBox::PluginManager::reloadAllPlugins | ( | ) |
Reloads all of the plugins in the system.
| SharedLibraryException | Thrown the PLUGIN_DESTROY_FUNC_NAME or PLUGIN_INIT_FUNC_NAME symbol is not found or the plugin could not be initialized. |
| PluginList const PWToolBox::PluginManager::getLoadedPlugins | ( | ) | const |
Retrieves a list of currently loaded plugins.
std::string const PWToolBox::PluginManager::PLUGIN_INIT_FUNC_NAME [static] |
The name of the initialization function. This value is "PluginInit".
std::string const PWToolBox::PluginManager::PLUGIN_DESTROY_FUNC_NAME [static] |
The name of the destruction function. This value is "PluginDestroy".
1.5.1