charon-core  0.3.1
UnixPluginLoader Class Reference

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

#include <charon-core/UnixPluginLoader.h>

Inheritance diagram for UnixPluginLoader:

Public Member Functions

 UnixPluginLoader (const std::string &name, std::vector< std::string > &plpaths, std::string &lSuffix, PluginManagerInterface::PluginVersionCheckLevel versionCheck=PluginManagerInterface::PluginVersionIgnore)
 Default constructor. More...
 
virtual ~UnixPluginLoader ()
 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

void * libHandle
 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 Unix systems like Linux or Mac OS X. 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
WindowsPluginLoader
PluginManager

Definition at line 40 of file UnixPluginLoader.h.

Constructor & Destructor Documentation

UnixPluginLoader::UnixPluginLoader ( const std::string &  name,
std::vector< std::string > &  plpaths,
std::string &  lSuffix,
PluginManagerInterface::PluginVersionCheckLevel  versionCheck = PluginManagerInterface::PluginVersionIgnore 
)

Definition at line 42 of file UnixPluginLoader.cpp.

UnixPluginLoader::~UnixPluginLoader ( )
virtual

Unloads the plugin from the memory

Definition at line 297 of file UnixPluginLoader.cpp.

References libHandle, and unload().

Member Function Documentation

void UnixPluginLoader::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 275 of file UnixPluginLoader.cpp.

References AbstractPluginLoader::create, AbstractPluginLoader::destroy, libHandle, AbstractPluginLoader::PluginException::PLUGIN_NOT_LOADED, AbstractPluginLoader::pluginName, and sout.


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