20 #ifndef TULIP_PLUGINLISTER_H
21 #define TULIP_PLUGINLISTER_H
27 #include <tulip/Iterator.h>
28 #include <tulip/Plugin.h>
29 #include <tulip/PluginLoader.h>
30 #include <tulip/Observable.h>
53 static tlp::Plugin *registeredPluginObject(
const std::string &name);
84 template <
typename PluginType>
86 Plugin *plugin = registeredPluginObject(pluginName);
87 return dynamic_cast<PluginType *
>(plugin) !=
nullptr;
101 template <
typename PluginType>
104 auto plugin = getPluginObject(name, context);
105 return dynamic_cast<PluginType *
>(plugin);
118 template <
typename PluginType>
120 std::list<std::string> keys;
122 for (
auto plugin : registeredPluginObjects()) {
123 if (
dynamic_cast<PluginType *
>(plugin))
124 keys.push_back(plugin->name());
197 static std::string getPluginRelease(
const std::string &name);
202 class TLP_SCOPE PluginEvent :
public Event {
204 enum PluginEventType { TLP_ADD_PLUGIN = 0, TLP_REMOVE_PLUGIN = 1 };
207 PluginEvent(
const Observable &sender, PluginEventType pluginEvtType,
208 const std::string &pluginName)
209 : Event(sender, Event::TLP_MODIFICATION), evtType(pluginEvtType), pluginName(pluginName) {}
211 PluginEventType getType()
const {
215 std::string getPluginName()
const {
219 static void addListener(Observable *);
222 PluginEventType evtType;
223 std::string pluginName;
Event is the base class for all events used in the Observation mechanism.
Contains runtime parameters for a plugin.
Top-level interface for plug-ins.
The PluginLister class is a singleton used to list plugins currently loaded into Tulip and retrieve i...
static std::list< std::string > availablePlugins()
Gets the list of plugins.
static std::string getPluginLibrary(const std::string &name)
Gets the library from which a plug-in has been loaded.
static const std::list< tlp::Dependency > & getPluginDependencies(const std::string &name)
Gets the dependencies of a plug-in.
static bool pluginExists(const std::string &pluginName)
Checks if a given name is registered in this factory.
static const ParameterDescriptionList & getPluginParameters(const std::string &name)
Gets the list of parameters for the given plug-in.
static void checkLoadedPluginsDependencies(tlp::PluginLoader *loader)
Checks if all registered plug-ins have their dependencies met.
static void registerPlugin(PluginFactory *objectFactory)
Registers a plugin into Tulip.
static std::list< std::string > availablePlugins()
Gets the list of plugins of a given type (template parameter).
static PluginType * getPluginObject(const std::string &name, tlp::PluginContext *context=nullptr)
Similar to tlp::PluginLister::getPluginObject() but returns a typed instance.
static const Plugin & pluginInformation(const std::string &name)
Gets more detailed information about one specific plug-in.
static bool pluginExists(const std::string &pluginName)
Checks if a plugin of a given type is loaded This method checks the plugin "pluginName" is currently ...
static tlp::Plugin * getPluginObject(const std::string &name, tlp::PluginContext *context=nullptr)
Constructs a plug-in.
static void removePlugin(const std::string &name)
Removes a plug-in from this factory. This is useful when a plug-in has unmet dependencies,...
Interface for Tulip iterators. Allows basic iteration operations only.
A callback class when loading plugins into Tulip.