Tulip  5.6.0
Large graphs analysis and drawing
tlp::PluginLister Class Reference

#include <PluginLister.h>

Static Public Member Functions

static std::list< std::string > availablePlugins ()
 
template<typename PluginType >
static std::list< std::string > availablePlugins ()
 
static void checkLoadedPluginsDependencies (tlp::PluginLoader *loader)
 
static const std::list< tlp::Dependency > & getPluginDependencies (const std::string &name)
 
static std::string getPluginLibrary (const std::string &name)
 
static tlp::PlugingetPluginObject (const std::string &name, tlp::PluginContext *context=nullptr)
 
template<typename PluginType >
static PluginType * getPluginObject (const std::string &name, tlp::PluginContext *context=nullptr)
 
static const ParameterDescriptionList & getPluginParameters (const std::string &name)
 
template<typename PluginType >
static bool pluginExists (const std::string &pluginName)
 
static bool pluginExists (const std::string &pluginName)
 
static const PluginpluginInformation (const std::string &name)
 
static void registerPlugin (PluginFactory *objectFactory)
 
static void removePlugin (const std::string &name)
 

Detailed Description

The PluginLister class is a singleton used to list plugins currently loaded into Tulip and retrieve information about them.

This class holds various methods to check information about plugins currently loaded into Tulip. You can use it to list plugins, get dependencies information or create an instance of a plugin.

Note
Since a plugin name is unique, Plugins are mainly identified by their name (tlp::Plugin::name()) when interfaced with the plugin lister.
See also
tlp::Plugin
tlp::PluginLoader
tlp::PluginLibraryLoader

Definition at line 51 of file PluginLister.h.

Member Function Documentation

◆ availablePlugins() [1/2]

static std::list<std::string> tlp::PluginLister::availablePlugins ( )
static

Gets the list of plugins.

Returns
A std::list<std::string> containing plugin names.

◆ availablePlugins() [2/2]

template<typename PluginType >
static std::list<std::string> tlp::PluginLister::availablePlugins ( )
inlinestatic

Gets the list of plugins of a given type (template parameter).

Returns
A std::list<std::string> containing plugin names.

Definition at line 119 of file PluginLister.h.

◆ checkLoadedPluginsDependencies()

static void tlp::PluginLister::checkLoadedPluginsDependencies ( tlp::PluginLoader loader)
static

Checks if all registered plug-ins have their dependencies met.

Parameters
loaderIf there are errors, the loader is informed about them so they can be displayed.
Returns
void

◆ getPluginDependencies()

static const std::list<tlp::Dependency>& tlp::PluginLister::getPluginDependencies ( const std::string &  name)
static

Gets the dependencies of a plug-in.

Parameters
nameThe name of the plug-in to retrieve the dependencies of.
Returns
:list< tlp::Dependency, std::allocator< tlp::Dependency > > The list of dependencies of the plug-in.

◆ getPluginLibrary()

static std::string tlp::PluginLister::getPluginLibrary ( const std::string &  name)
static

Gets the library from which a plug-in has been loaded.

Parameters
nameThe name of the plug-in to retrieve the library of.
Returns
std::string The library from which the plug-in was loaded.

◆ getPluginObject() [1/2]

static tlp::Plugin* tlp::PluginLister::getPluginObject ( const std::string &  name,
tlp::PluginContext context = nullptr 
)
static

Constructs a plug-in.

Parameters
nameThe name of the plug-in to instantiate.
pThe context to give to the plug-in.
Returns
ObjectType* The newly constructed plug-in.

◆ getPluginObject() [2/2]

template<typename PluginType >
static PluginType* tlp::PluginLister::getPluginObject ( const std::string &  name,
tlp::PluginContext context = nullptr 
)
inlinestatic

Similar to tlp::PluginLister::getPluginObject() but returns a typed instance.

This method instantiate a plugin from its name and returns it casted into the given type.

Parameters
nameThe plugin's name
contextThe context to give to the plugin
Returns
The plugin instance. If there is no such plugin or if the plugin does not match the required type, this method returns nullptr

Definition at line 102 of file PluginLister.h.

◆ getPluginParameters()

static const ParameterDescriptionList& tlp::PluginLister::getPluginParameters ( const std::string &  name)
static

Gets the list of parameters for the given plug-in.

Parameters
nameThe name of the plug-in to retrieve the parameters of.
Returns
:ParameterDescriptionList The parameters of the plug-in.

◆ pluginExists() [1/2]

template<typename PluginType >
static bool tlp::PluginLister::pluginExists ( const std::string &  pluginName)
inlinestatic

Checks if a plugin of a given type is loaded This method checks the plugin "pluginName" is currently loaded into Tulip and if it's of type PluginType.

Parameters
PluginTypethe class type of the plugin
pluginNamethe name of the plugin
Returns
true if a matching plugin is currently loaded into Tulip.

Definition at line 85 of file PluginLister.h.

◆ pluginExists() [2/2]

static bool tlp::PluginLister::pluginExists ( const std::string &  pluginName)
static

Checks if a given name is registered in this factory.

Parameters
pluginNameThe name of the plug-in to look for.
Returns
bool Whether there is a plug-in with the given name registered in this factory.

◆ pluginInformation()

static const Plugin& tlp::PluginLister::pluginInformation ( const std::string &  name)
static

Gets more detailed information about one specific plug-in.

Parameters
nameThe name of the plugin to retrieve information for.
Returns
:const Plugin& The information on the plugin.

◆ registerPlugin()

static void tlp::PluginLister::registerPlugin ( PluginFactory *  objectFactory)
static

Registers a plugin into Tulip.

Warning
This method should only be called by tlp::PluginFactory subclasses
See also
PLUGIN

◆ removePlugin()

static void tlp::PluginLister::removePlugin ( const std::string &  name)
static

Removes a plug-in from this factory. This is useful when a plug-in has unmet dependencies, or appears more than once.

Parameters
nameThe name of the plug-in to remove.
Returns
void