26 #ifndef __TERRALIB_PLUGIN_INTERNAL_PLUGINMANAGER_H
27 #define __TERRALIB_PLUGIN_INTERNAL_PLUGINMANAGER_H
30 #include "../common/Singleton.h"
40 #include <boost/ptr_container/ptr_vector.hpp>
74 std::vector<std::string> getPlugins()
const;
85 const PluginInfo& getPlugin(
const std::string& name)
const;
88 const boost::ptr_vector<PluginInfo>& getUnloadedPlugins()
const;
91 void setUnloadedPlugins(boost::ptr_vector<te::plugin::PluginInfo> unloadedPlugins);
94 const boost::ptr_vector<PluginInfo>& getBrokenPlugins()
const;
97 void setBrokenPlugins(boost::ptr_vector<te::plugin::PluginInfo> brokenPlugins);
102 bool isBrokenPlugin(
const std::string& pluginName)
const;
107 bool isUnloadedPlugin(
const std::string& pluginName)
const;
116 bool isLoaded(
const std::string& pname)
const;
145 void remove(
const std::string& plugin);
166 void loadAll(
const bool start =
true);
201 void load(boost::ptr_vector<PluginInfo>& plugins,
const bool start =
true);
221 void load(
const PluginInfo& pInfo,
const bool start =
true);
223 void load(
const std::string& pluginName);
234 void unload(
const std::string& name);
265 std::size_t getNumPlugins()
const;
276 bool isLoaded(
const std::vector<std::string>& plugins)
const;
285 std::vector<std::string> getDependents(
const std::string& pluginName)
const;
294 bool hasDependents(
const std::string& pluginName)
const;
312 void getCategories(std::vector<std::string>& categories)
const;
319 void addCategory(
const std::string& name);
326 void sort(boost::ptr_vector<PluginInfo>& plugins)
const;
334 void removeFromCategory(
AbstractPlugin* plugin,
const std::string& category);
336 void moveToBrokenList(
const PluginInfo& pInfo);
338 void removeFromBrokenList(
const PluginInfo& pInfo);
340 void removeFromUnloadedList(
const PluginInfo& pInfo);
342 void moveDependentsToBrokenList(
const std::string& plugin,
const bool& unloadPlugin=
false);
344 void updateDependents(
const std::string& plugin);
367 #endif // __TERRALIB_PLUGIN_INTERNAL_PLUGINMANAGER_H
An abstract class for TerraLib Plugins.
boost::ptr_vector< PluginInfo > m_brokenPlugins
The list of plugins that could not be loaded.
std::vector< AbstractPlugin * > m_plugins
The list of managed plugins: this will be need to unload accordinly the plugins!
Configuration flags for the TerraLib Plugin module.
An exception class for the Plugin module.
A singleton for managing plugins.
boost::ptr_vector< PluginInfo > m_unloadedPlugins
The list of plugins that are not loaded.
std::map< std::string, AbstractPlugin * > m_pluginsMap
A map from (plugin's name) to (plugin instance).
std::vector< AbstractFinder * > m_finders
The list of plugin finders.
#define TEPLUGINEXPORT
You can use this macro in order to export/import classes and functions from this module.
The basic information about a plugin.
std::map< std::string, std::vector< AbstractPlugin * > > m_pluginCategoryMap
A map from (plugin category) to (plugins in category)
Template support for singleton pattern.