31 #ifndef __TERRALIB_CORE_PLUGIN_PLUGINMANAGER_H__
32 #define __TERRALIB_CORE_PLUGIN_PLUGINMANAGER_H__
35 #include "../Config.h"
93 bool isBroken(
const std::string& plugin_name)
const;
104 bool isLoaded(
const std::string& plugin_name)
const;
118 bool exists(
const std::string& plugin_name)
const;
145 void remove(
const std::string& plugin_name);
174 void load(
const std::string& plugin_name,
const bool start =
true);
182 void start(
const std::string& plugin_name);
190 void stop(
const std::string& plugin_name);
201 void unload(
const std::string& plugin_name);
The basic information about a plugin.
A singleton for managing plugins.
std::vector< std::string > getDependents(const std::string plugin_name)
Return the list of plugins that depends of a given plugin.
void clear()
Stop and unload all plugins, then clear the internal list of plugins.
PluginManager(const PluginManager &)
void recursiveUnload(const std::string &plugin_name)
Try to unload a given plugin and its dependents recursively.
std::vector< PluginInfo > getUnloadedPlugins() const
Return the list of plugins that were not loaded.
void remove(const std::string &plugin_name)
Remove plugin from the manager.
bool isBroken(const std::string &plugin_name) const
Returns true if the plugin is in the broken list of plugins.
void insert(const PluginInfo &pinfo)
Adds plugin with its plugin information to the list of unloaded plugins.
~PluginManager()
Destructor.
PluginManager()
Constructor.
void load(const std::string &plugin_name, const bool start=true)
It tries to load the informed plugin.
void unload(const std::string &plugin_name)
Try to unload a given plugin.
bool exists(const std::string &plugin_name) const
Tells if a given plugin is registered or not.
bool isFixed(const std::string &plugin_name)
Returns true if the plugin has been fixed and moves it to the unloaded list otherwise returns false.
std::vector< PluginInfo > getBrokenPlugins() const
Return the list of plugins that could not be loaded.
std::vector< std::string > getPlugins() const
Return the list of plugins managed by PluginManager.
void start(const std::string &plugin_name)
Start a loaded plugin.
static PluginManager & instance()
Access the singleton.
void stop(const std::string &plugin_name)
Stop a loaded plugin.
const PluginInfo & getPluginInfo(const std::string &name) const
Return information about a plugin identified by the given name.
bool isLoaded(const std::string &plugin_name) const
Returns true if the plugin is loaded otherwise returns false.
std::vector< PluginInfo > getLoadedPlugins() const
Return the list of plugins that are loaded.
PluginManager & operator=(const PluginManager &)
bool isUnloaded(const std::string &plugin_name) const
Returns true if the plugin is in the not-loaded list of plugins.
bool validatySharedLibraryName(const std::string &shared_library_name) const
Returns true if was found a plugin with the same shared library name loaded otherwise returns false.
Basic information about a plugin.