charon-core  0.3.1
WindowsPluginLoader Class Reference

Handles ParameteredObject based plugins on Windows based systems. More...

#include <charon-core/WindowsPluginLoader.h>

Inheritance diagram for WindowsPluginLoader:

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

Detailed Description

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.

See Also
AbstractPluginLoader
UnixPluginLoader
PluginManager

Definition at line 40 of file WindowsPluginLoader.h.

Constructor & Destructor Documentation

WindowsPluginLoader::WindowsPluginLoader ( const std::string &  n,
std::vector< std::string > &  plpaths,
std::string &  lSuffix,
PluginManagerInterface::PluginVersionCheckLevel  versionCheck = PluginManagerInterface::PluginVersionIgnore 
)
Parameters
nName of the plugin
plpathsList of plugin search paths
lSuffixsuffix which gets appended to the plugin name before a search
versionCheckset how to handle version check on plugin load

Definition at line 37 of file WindowsPluginLoader.cpp.

References hInstLibrary.

WindowsPluginLoader::~WindowsPluginLoader ( )
virtual

Unloads the plugin from the memory.

Definition at line 367 of file WindowsPluginLoader.cpp.

References hInstLibrary, and unload().

Member Function Documentation

void WindowsPluginLoader::unload ( )
throw (PluginException
)
virtual

Removes the shared library from the memory. Existing instances of the plugin will become obsolete.

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


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