charon-core
0.3.1
|
Handles ParameteredObject based plugins on Windows based systems. More...
#include <charon-core/WindowsPluginLoader.h>
Public Member Functions | |
WindowsPluginLoader (const std::string &n, std::vector< std::string > &plpaths, std::string &lSuffix, PluginManagerInterface::PluginVersionCheckLevel versionCheck=PluginManagerInterface::PluginVersionIgnore) | |
Default constructor. More... | |
virtual | ~WindowsPluginLoader () |
Default destructor. More... | |
virtual void | load () throw (PluginException) |
Loads the plugin. More... | |
virtual void | unload () throw (PluginException) |
Unloads the plugin. More... | |
Public Member Functions inherited from AbstractPluginLoader | |
AbstractPluginLoader (const std::string &name, std::vector< std::string > &plpaths, std::string &lSuffix, PluginManagerInterface::PluginVersionCheckLevel versionCheck=PluginManagerInterface::PluginVersionIgnore) | |
Default constructor. More... | |
virtual | ~AbstractPluginLoader () |
Default Destructor. More... | |
virtual ParameteredObject * | createInstance (const std::string &name, ParameteredObject::template_type t=ParameteredObject::TYPE_DOUBLE) throw (PluginException) |
Creates an instance of the loaded plugin and returns a pointer to it. More... | |
virtual void | destroyInstance (ParameteredObject *p) throw (PluginException) |
Deletes an instance of the loaded plugin. More... | |
virtual const std::string & | getName () const |
Get the name of the plugin. More... | |
Private Attributes | |
HINSTANCE | hInstLibrary |
Points to the loaded library. | |
Additional Inherited Members | |
Protected Attributes inherited from AbstractPluginLoader | |
PluginManagerInterface::PluginVersionCheckLevel | _versionCheck |
should the Loader ignore embedded charon-core version strings? | |
ParameteredObject *(* | create )(const std::string &, ParameteredObject::template_type) |
Function pointer to the constructor of the plugin. | |
void(* | destroy )(ParameteredObject *) |
Function pointer to the destructor of the plugin. | |
ParameteredObject::build_type(* | getBuildType )() |
Function pointer to the getBuildType function of the plugin. | |
std::string & | libSuffix |
Lib suffix e.g. _d for debug builds. | |
std::string | pluginName |
The name of the Plugin (without prefix "lib" and without extension) | |
std::vector< std::string > & | pluginPaths |
Paths where the plugins are stored. | |
The UnixPluginLoader can load plugins based on the ParameteredObject class on Windows systems. It it based on the abstract class AbstractPluginLoader. You usually don't need to use this class directly. The PluginManager class handles this for you.
Definition at line 40 of file WindowsPluginLoader.h.
WindowsPluginLoader::WindowsPluginLoader | ( | const std::string & | n, |
std::vector< std::string > & | plpaths, | ||
std::string & | lSuffix, | ||
PluginManagerInterface::PluginVersionCheckLevel | versionCheck = PluginManagerInterface::PluginVersionIgnore |
||
) |
n | Name of the plugin |
plpaths | List of plugin search paths |
lSuffix | suffix which gets appended to the plugin name before a search |
versionCheck | set how to handle version check on plugin load |
Definition at line 37 of file WindowsPluginLoader.cpp.
References hInstLibrary.
|
virtual |
Unloads the plugin from the memory.
Definition at line 367 of file WindowsPluginLoader.cpp.
References hInstLibrary, and unload().
|
virtual |
Loads the shared library referring to the given plugin name into the memory and initializes the function pointers to the constructor and destructor of the plugin.
AbstractPluginLoader::PluginException |
Implements AbstractPluginLoader.
Definition at line 74 of file WindowsPluginLoader.cpp.
References AbstractPluginLoader::_versionCheck, FileTool::changeDir(), CHARON_CORE_VERSION, AbstractPluginLoader::create, ParameteredObject::DEBUG_BUILD, AbstractPluginLoader::destroy, FileTool::exists(), AbstractPluginLoader::PluginException::FILE_DAMAGED, AbstractPluginLoader::PluginException::FILE_NOT_FOUND, AbstractPluginLoader::getBuildType, FileTool::getCurrentDir(), hInstLibrary, AbstractPluginLoader::PluginException::INCOMPATIBLE_BUILD_TYPE, AbstractPluginLoader::PluginException::INVALID_PLUGIN_FORMAT, AbstractPluginLoader::libSuffix, AbstractPluginLoader::pluginName, AbstractPluginLoader::pluginPaths, ParameteredObject::RELEASE_BUILD, sout, AbstractPluginLoader::PluginException::VERSION_INFORMATION_MISSING, and AbstractPluginLoader::PluginException::VERSION_MISSMATCH.
|
virtual |
Removes the shared library from the memory. Existing instances of the plugin will become obsolete.
AbstractPluginLoader::PluginException |
Implements AbstractPluginLoader.
Definition at line 353 of file WindowsPluginLoader.cpp.
References AbstractPluginLoader::create, AbstractPluginLoader::destroy, hInstLibrary, AbstractPluginLoader::PluginException::PLUGIN_NOT_LOADED, AbstractPluginLoader::pluginName, and sout.