41 std::unique_ptr<te::core::AbstractPluginEngine> cppengine(
55 std::string p1_manifest_file =
61 std::unique_ptr<te::core::AbstractPlugin> p1(plugin_engine.
load(p1_info));
67 std::string p3_manifest_file =
73 std::unique_ptr<te::core::AbstractPlugin> p3(plugin_engine.
load(p3_info));
79 plugin_engine.
unload(std::move(p3));
82 plugin_engine.
unload(std::move(p1));
88 std::vector<te::core::PluginInfo> v_pInfo;
109 std::vector<te::core::PluginInfo> pVec =
113 for (
auto plugin = pVec.rbegin(); plugin != pVec.rend(); ++plugin)
121 int main(
int argc,
char* argv[])
130 catch(boost::exception& e)
132 std::string* err = boost::get_error_info<te::ErrorDescription>(e);
133 std::cerr << *err << std::endl;
TECOREEXPORT void FinalizePluginSystem()
void insert(std::unique_ptr< AbstractPluginEngine > engine)
Register a new plugin engine.
Include files for Core Plugin Library.
TECOREEXPORT std::vector< PluginInfo > TopologicalSort(const std::vector< PluginInfo > &v_pinfo)
void stop(const std::string &plugin_name)
Stop a loaded plugin.
void insert(const PluginInfo &pinfo)
Adds plugin with its plugin information to the list of unloaded plugins.
int main(int argc, char *argv[])
Basic information about a plugin.
void load(const std::string &plugin_name, const bool start=true)
It tries to load the informed plugin.
virtual std::unique_ptr< AbstractPlugin > load(const PluginInfo &pinfo)=0
Load the informed plugin.
static PluginManager & instance()
Access the singleton.
Include files for Core Utility Library.
void WithoutPluginManager()
AbstractPluginEngine & get(const std::string &engine_id) const
Find a plugin engine with the given id.
The base class for plugin engines.
virtual void unload(std::unique_ptr< AbstractPlugin > plugin)=0
Unload the informed plugin.
TECOREEXPORT PluginInfo JSONPluginInfoSerializer(const std::string &file_name)
A plugin finder that search for plugins in some special directories defined by compile time macros...
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.
TECOREEXPORT void InitializePluginSystem()
void clear()
Stop and unload all plugins, then clear the internal list of plugins.
std::vector< PluginInfo > getLoadedPlugins() const
Return the list of plugins that are loaded.
void unload(const std::string &plugin_name)
Try to unload a given plugin.
static PluginEngineManager & instance()
Access the singleton.