libyui  3.4.2
YUIPlugin Class Reference

Wrapper class for dlopen() and related. More...

#include <YUIPlugin.h>

Inheritance diagram for YUIPlugin:
YGraphPlugin YPackageSelectorPlugin

Public Member Functions

 YUIPlugin (const char *pluginLibBaseName)
 Constructor: Load the specified plugin library from the standard UI plugin directory (/usr/lib/yui/).
 
virtual ~YUIPlugin ()
 Destructor. More...
 
void unload ()
 Unload this plugin. More...
 
void * locateSymbol (const char *symbol)
 Try to locate the specified symbol (function or global variable) in the plugin library. More...
 
bool error () const
 Returns 'true' if there was an error loading the plugin.
 
bool success () const
 Returns 'true' if there was no error loading the plugin.
 
std::string errorMsg () const
 Returns a human readable (but in most cases untranslated) error message if there was an error.
 

Protected Member Functions

void * pluginLibHandle ()
 Returns the dlopen() handle of the plugin library.
 
std::string pluginLibBaseName () const
 Returns the base name of the plugin library.
 
std::string pluginLibFullPath () const
 Returns the full path of the plugin library.
 

Detailed Description

Wrapper class for dlopen() and related.

Definition at line 35 of file YUIPlugin.h.

Constructor & Destructor Documentation

◆ ~YUIPlugin()

YUIPlugin::~YUIPlugin ( )
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.

Member Function Documentation

◆ locateSymbol()

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.

◆ unload()

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.


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