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

#include <PluginLister.h>

+ Inheritance diagram for tlp::PluginLister:
+ Collaboration diagram for tlp::PluginLister:

Public Member Functions

template<typename PluginType >
std::list< std::string > availablePlugins ()
 
template<typename PluginType >
PluginType * getPluginObject (const std::string &name, tlp::PluginContext *context)
 
template<typename PluginType >
bool pluginExists (const std::string &pluginName)
 
- Public Member Functions inherited from tlp::Observable
void addListener (Observable *const listener) const
 
void addObserver (Observable *const observer) const
 
unsigned int countListeners () const
 
unsigned int countObservers () const
 
unsigned int getReceived () const
 
unsigned int getSent () const
 
void removeListener (Observable *const listener) const
 
void removeObserver (Observable *const observerver) const
 

Static Public Member Functions

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)
 
static const ParameterDescriptionListgetPluginParameters (const std::string &name)
 
static tlp::PluginListerinstance ()
 
static bool pluginExists (const std::string &pluginName)
 
static const PluginpluginInformation (const std::string &name)
 
static void registerPlugin (FactoryInterface *objectFactory)
 
static void removePlugin (const std::string &name)
 
- Static Public Member Functions inherited from tlp::Observable
static tlp::node getNode (const tlp::Observable *obs)
 
static ObservablegetObject (tlp::node n)
 
static const tlp::VectorGraph & getObservableGraph ()
 
static unsigned int getScheduled (tlp::node n)
 
static void holdObservers ()
 
static bool isAlive (tlp::node n)
 
static unsigned int observersHoldCounter ()
 
static void unholdObservers ()
 

Static Public Attributes

static PluginLoadercurrentLoader
 

Additional Inherited Members

- Protected Member Functions inherited from tlp::Observable
 Observable (const Observable &)
 
tlp::Iterator< tlp::Observable * > * getObservables () const
 
bool hasOnlookers () const
 
void notifyObservers ()
 
void observableDeleted ()
 
Observableoperator= (const Observable &)
 
void sendEvent (const Event &message)
 
virtual void treatEvent (const Event &message)
 
virtual void treatEvents (const std::vector< Event > &events)
 

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 62 of file PluginLister.h.

Member Function Documentation

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

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

Returns
A std::list<std::string> containing plugin names.
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
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.
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.
static tlp::Plugin* tlp::PluginLister::getPluginObject ( const std::string &  name,
tlp::PluginContext context 
)
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.
template<typename PluginType >
PluginType* tlp::PluginLister::getPluginObject ( const std::string &  name,
tlp::PluginContext context 
)
inline

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 NULL

Definition at line 128 of file PluginLister.h.

+ Here is the call graph for this function:

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.
static tlp::PluginLister* tlp::PluginLister::instance ( )
static

Gets the static instance of this class. If not already done, creates it beforehand.

Returns
PluginLister< ObjectType, Context >* The only instance of this object that exists in the whole program.

+ Here is the caller graph for this function:

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

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 110 of file PluginLister.h.

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.
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.
static void tlp::PluginLister::registerPlugin ( FactoryInterface *  objectFactory)
static

Registers a plugin into Tulip.

Warning
This method should only be called by tlp::FactoryInterface subclasses
See also
PLUGIN
static void tlp::PluginLister::removePlugin ( const std::string &  name)
static

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

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