RSC
0.19.0
|
Instances of this class represent pieces of functionality which can be loaded into a program at runtime. More...
#include <Plugin.h>
Public Member Functions | |
virtual | ~Plugin () |
const std::string & | getName () const |
Returns the name of the plugin. More... | |
void | load (bool wrapExceptions=true) |
Tries to load the functionality of the plugin into the current process. More... | |
void | unload (bool wrapExceptions=true) |
Tries to unload the functionality of the plugin. More... | |
bool | ensureLoaded (bool wrapExceptions=true) |
Tries to load the plugin unless it is already loaded. More... | |
std::string | getLibrary () const |
Returns the path to the library implementing this plugin. More... | |
Private Member Functions | |
Plugin (Impl *impl) | |
Static Private Member Functions | |
static boost::shared_ptr< Plugin > | create (const std::string &name, const std::string &library) |
Private Attributes | |
boost::scoped_ptr< Impl > | impl |
Friends | |
class | Manager |
Instances of this class represent pieces of functionality which can be loaded into a program at runtime.
Plugin instances are not thread-safe and access needs to be synchronized.
|
virtual |
Definition at line 220 of file Plugin.cpp.
|
private |
Definition at line 216 of file Plugin.cpp.
Referenced by create().
|
staticprivate |
Definition at line 243 of file Plugin.cpp.
References Plugin().
Referenced by rsc::plugins::Manager::addPath().
bool rsc::plugins::Plugin::ensureLoaded | ( | bool | wrapExceptions = true | ) |
Tries to load the plugin unless it is already loaded.
wrapExceptions | If true , exceptions thrown in the init method of the plugin are wrapped in a runtime_error exception. |
false
if the plugin was already loaded. true
otherwise. runtime_error | If the plugin cannot be loaded for some reason. |
Definition at line 235 of file Plugin.cpp.
References impl.
string rsc::plugins::Plugin::getLibrary | ( | ) | const |
Returns the path to the library implementing this plugin.
Definition at line 239 of file Plugin.cpp.
References impl.
const string & rsc::plugins::Plugin::getName | ( | ) | const |
Returns the name of the plugin.
Definition at line 223 of file Plugin.cpp.
References impl.
void rsc::plugins::Plugin::load | ( | bool | wrapExceptions = true | ) |
Tries to load the functionality of the plugin into the current process.
wrapExceptions | if true , exceptions generated inside the plugin init method are wrapped in a runtime_error. Otherwise they are passed through. |
runtime_error | If the plugin cannot be loaded for some reason. |
Definition at line 227 of file Plugin.cpp.
References impl.
void rsc::plugins::Plugin::unload | ( | bool | wrapExceptions = true | ) |
Tries to unload the functionality of the plugin.
wrapExceptions | if true , exceptions generated inside the plugin init method are wrapped in a runtime_error. Otherwise they are passed through. |
runtime_error | If the plugin cannot be unloaded for some reason. |
Definition at line 231 of file Plugin.cpp.
References impl.
|
private |
Definition at line 111 of file Plugin.h.
Referenced by ensureLoaded(), getLibrary(), getName(), load(), and unload().