libyui
3.0.5
|
#include <YUIPlugin.h>
Public Member Functions | |
YUIPlugin (const char *pluginLibBaseName) | |
virtual | ~YUIPlugin () |
void | unload () |
void * | locateSymbol (const char *symbol) |
bool | error () const |
bool | success () const |
std::string | errorMsg () const |
Protected Member Functions | |
void * | pluginLibHandle () |
std::string | pluginLibBaseName () const |
std::string | pluginLibFullPath () const |
Wrapper class for dlopen() and related.
Definition at line 35 of file YUIPlugin.h.
YUIPlugin::YUIPlugin | ( | const char * | pluginLibBaseName | ) |
Constructor: Load the specified plugin library from the standard UI plugin directory (/usr/lib/yui/).
Definition at line 37 of file YUIPlugin.cc.
|
virtual |
Destructor.
Please note that this will NOT attempt to unload the plugin library since this is usually counterproductive. If unloading the plugin is desired, call unload() manually.
Definition at line 57 of file YUIPlugin.cc.
bool YUIPlugin::error | ( | ) | const |
Returns 'true' if there was an error loading the plugin.
Definition at line 104 of file YUIPlugin.cc.
std::string YUIPlugin::errorMsg | ( | ) | const |
Returns a human readable (but in most cases untranslated) error message if there was an error.
Definition at line 116 of file YUIPlugin.cc.
void * YUIPlugin::locateSymbol | ( | const char * | symbol | ) |
Try to locate the specified symbol (function or global variable) in the plugin library.
Returns the in-memory address of that symbol or 0 if it could not be found or if loading the plugin library had failed in the constructor.
Definition at line 86 of file YUIPlugin.cc.
|
inlineprotected |
Returns the base name of the plugin library.
Definition at line 96 of file YUIPlugin.h.
|
protected |
Returns the full path of the plugin library.
Definition at line 73 of file YUIPlugin.cc.
|
inlineprotected |
Returns the dlopen() handle of the plugin library.
Definition at line 91 of file YUIPlugin.h.
bool YUIPlugin::success | ( | ) | const |
Returns 'true' if there was no error loading the plugin.
Definition at line 110 of file YUIPlugin.cc.
void YUIPlugin::unload | ( | ) |
Unload this plugin. This calls dlclose() which will unload the plugin library if it is no longer used, i.e. if the reference count dlopen() uses reaches 0.
Definition at line 65 of file YUIPlugin.cc.