Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::PluginLibraryLoader Class Reference

#include <PluginLibraryLoader.h>

Static Public Member Functions

static const std::string & getCurrentPluginFileName ()
 
static bool loadPluginLibrary (const std::string &filename, PluginLoader *loader=NULL)
 
static void loadPlugins (PluginLoader *loader=NULL, const std::string &pluginPath="")
 

Detailed Description

This class takes care of the actual loading of the libraries. You can use it to load a single plugin (loadPluginLibrary) or all the plugins in a given folder (loadPlugins).0.

It is a singleton to guarantee the currentPluginLibrary member is initialized, but it only shows static functions for syntactic sugar.

Definition at line 42 of file PluginLibraryLoader.h.

Member Function Documentation

static const std::string& tlp::PluginLibraryLoader::getCurrentPluginFileName ( )
inlinestatic

Gets the name of the plug-in library being loaded. If the plugin is statically linked into the tulip library, returns an empty string.

Returns
:string& The name of the plugin library being loaded.

Definition at line 88 of file PluginLibraryLoader.h.

static bool tlp::PluginLibraryLoader::loadPluginLibrary ( const std::string &  filename,
PluginLoader loader = NULL 
)
static

Loads a single plugin library.

Parameters
filenameThe name of the plugin file to load.
loaderA loader to report what is going on (only its loaded or aborted functions will be called) Defaults to 0.
Returns
bool Whether the plugin was sucessfully loaded.
static void tlp::PluginLibraryLoader::loadPlugins ( PluginLoader loader = NULL,
const std::string &  pluginPath = "" 
)
static

Loads all the plugins in each directory contained in TulipPluginsPath. This function will not look into subfolders of the specified folder.

To load all the plugins in the following example, you need to call this function once for the lib/tulip folder, once for the glyph folder, and once for the interactors folder.

lib/tulip/ -> glyphs |-> libBillboard-4.0.0.so |-> libWindow-4.0.0.so -> interactors |-> libInteractorAddEdge-4.0.0.so |-> libInteractorSelectionModifier-4.0.0.so -> libAdjacencyMatrixImport-4.0.0.so -> libColorMapping-4.0.0.so -> libCompleteGraph-4.0.0.so

Parameters
loaderA PluginLoader to output what is going on. Defaults to 0.
pluginPathA folder to append to each path in TulipPluginsPath (e.g. "glyphs/")