knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <PluginManager.h>
Public Member Functions | |
PluginManager () | |
virtual | ~PluginManager () |
auto | managerID () const |
const auto & | plugins () const |
std::shared_ptr< NamedPlugin< T > > | getPluginWithID (std::string_view pluginID) |
virtual std::shared_ptr< NamedPlugin< T > > | loadPlugin (const boost::property_tree::ptree &config)=0 |
virtual std::shared_ptr< NamedPlugin< T > > | addPlugin (std::string_view reasonerID, PluginLanguage language, const std::shared_ptr< T > &reasoner)=0 |
void | removePlugin (const std::shared_ptr< NamedPlugin< T >> &namedPlugin) |
void | removePlugin (std::string_view pluginID) |
PluginManager () | |
virtual | ~PluginManager () |
auto | managerID () const |
const auto & | plugins () const |
std::shared_ptr< NamedPlugin< T > > | getPluginWithID (std::string_view pluginID) |
virtual std::shared_ptr< NamedPlugin< T > > | loadPlugin (const boost::property_tree::ptree &config)=0 |
virtual std::shared_ptr< NamedPlugin< T > > | addPlugin (std::string_view reasonerID, PluginLanguage language, const std::shared_ptr< T > &reasoner)=0 |
void | removePlugin (const std::shared_ptr< NamedPlugin< T >> &namedPlugin) |
void | removePlugin (std::string_view pluginID) |
Static Public Member Functions | |
static PluginManager< T > * | getManager (uint32_t managerID) |
static bool | addFactory (std::string_view typeName, const std::shared_ptr< PluginFactory< T >> &factory) |
template<class U > | |
static bool | addFactory (std::string_view typeName) |
static PluginManager< T > * | getManager (uint32_t managerID) |
static bool | addFactory (std::string_view typeName, const std::shared_ptr< PluginFactory< T >> &factory) |
template<class U > | |
static bool | addFactory (std::string_view typeName) |
Protected Member Functions | |
std::shared_ptr< PluginLibrary< T > > | loadSharedLibrary (std::string_view path) |
std::shared_ptr< PluginModule< T > > | loadPythonModule (std::string_view path, std::string_view type) |
std::shared_ptr< PluginFactory< T > > | findFactory (const boost::property_tree::ptree &config) |
std::string | getPluginID (const std::shared_ptr< PluginFactory< T >> &factory, const boost::property_tree::ptree &config) |
std::shared_ptr< PluginLibrary< T > > | loadSharedLibrary (std::string_view path) |
std::shared_ptr< PluginModule< T > > | loadPythonModule (std::string_view path, std::string_view type) |
std::shared_ptr< PluginFactory< T > > | findFactory (const boost::property_tree::ptree &config) |
std::string | getPluginID (const std::shared_ptr< PluginFactory< T >> &factory, const boost::property_tree::ptree &config) |
Static Protected Member Functions | |
static uint32_t & | managerIDCounter () |
static auto & | pluginFactories () |
static auto & | pluginManagers () |
static uint32_t & | managerIDCounter () |
static auto & | pluginFactories () |
static auto & | pluginManagers () |
Protected Attributes | |
std::shared_ptr< std::map< uint32_t, PluginManager * > > | pluginManagers_ |
std::mutex | staticMutex_ |
uint32_t | managerID_ |
uint32_t | pluginIndex_ = 0 |
std::map< std::string_view, std::shared_ptr< NamedPlugin< T > >, std::less<> > | pluginPool_ |
std::map< std::string, std::shared_ptr< PluginLibrary< T > >, std::less<> > | loadedPlugins_ |
std::map< std::string, std::shared_ptr< PluginModule< T > >, std::less<> > | loadedModules_ |
Manages a set of available plugins.
T | the type of the plugin. |
Definition at line 26 of file PluginManager.h.
|
inline |
Definition at line 28 of file PluginManager.h.
|
inlinevirtual |
Definition at line 35 of file PluginManager.h.
|
inline |
Definition at line 28 of file PluginManager.h.
|
inlinevirtual |
Definition at line 35 of file PluginManager.h.
|
inlinestatic |
Add a typed plugin factory to the manager.
typeName | the name of the plugin type |
Definition at line 106 of file PluginManager.h.
|
inlinestatic |
Add a typed plugin factory to the manager.
typeName | the name of the plugin type |
Definition at line 106 of file PluginManager.h.
|
inlinestatic |
Add a plugin factory to the manager. Note that factories for shared libraries are created on the fly, and thus do not need to be added manually.
typeName | the name of the plugin type |
factory | a plugin factory |
Definition at line 92 of file PluginManager.h.
|
inlinestatic |
Add a plugin factory to the manager. Note that factories for shared libraries are created on the fly, and thus do not need to be added manually.
typeName | the name of the plugin type |
factory | a plugin factory |
Definition at line 92 of file PluginManager.h.
|
pure virtual |
Add a plugin to this manager.
reasonerID | the name of the reasoner |
language | the language of the plugin |
reasoner | the reasoner instance |
Implemented in knowrob::ReasonerManager, and knowrob::ReasonerManager.
|
pure virtual |
Add a plugin to this manager.
reasonerID | the name of the reasoner |
language | the language of the plugin |
reasoner | the reasoner instance |
Implemented in knowrob::ReasonerManager, and knowrob::ReasonerManager.
|
inlineprotected |
Definition at line 209 of file PluginManager.h.
|
inlineprotected |
Definition at line 209 of file PluginManager.h.
|
inlinestatic |
managerID | the ID of a plugin manager |
Definition at line 63 of file PluginManager.h.
|
inlinestatic |
managerID | the ID of a plugin manager |
Definition at line 63 of file PluginManager.h.
|
inlineprotected |
Definition at line 237 of file PluginManager.h.
|
inlineprotected |
Definition at line 237 of file PluginManager.h.
|
inline |
pluginID | a backend ID string. |
Definition at line 76 of file PluginManager.h.
|
inline |
pluginID | a backend ID string. |
Definition at line 76 of file PluginManager.h.
|
pure virtual |
Load a new plugin instance into the plugin manager. The type of the plugin is determined based on either the value of "type", "lib" or "module" in the property tree root. The tree is further used to generate a plugin configuration. Plugin factories for libraries are created on the fly, the ones for built-in plugin types need to be added to the plugin manager before.
config | a property tree holding a plugin configuration |
Implemented in knowrob::StorageManager, knowrob::ReasonerManager, knowrob::StorageManager, and knowrob::ReasonerManager.
|
pure virtual |
Load a new plugin instance into the plugin manager. The type of the plugin is determined based on either the value of "type", "lib" or "module" in the property tree root. The tree is further used to generate a plugin configuration. Plugin factories for libraries are created on the fly, the ones for built-in plugin types need to be added to the plugin manager before.
config | a property tree holding a plugin configuration |
Implemented in knowrob::StorageManager, knowrob::ReasonerManager, knowrob::StorageManager, and knowrob::ReasonerManager.
|
inlineprotected |
Definition at line 193 of file PluginManager.h.
|
inlineprotected |
Definition at line 193 of file PluginManager.h.
|
inlineprotected |
Definition at line 176 of file PluginManager.h.
|
inlineprotected |
Definition at line 176 of file PluginManager.h.
|
inline |
|
inline |
|
inlinestaticprotected |
Definition at line 159 of file PluginManager.h.
|
inlinestaticprotected |
Definition at line 159 of file PluginManager.h.
|
inlinestaticprotected |
Definition at line 165 of file PluginManager.h.
|
inlinestaticprotected |
Definition at line 165 of file PluginManager.h.
|
inlinestaticprotected |
Definition at line 171 of file PluginManager.h.
|
inlinestaticprotected |
Definition at line 171 of file PluginManager.h.
|
inline |
|
inline |
|
inline |
Remove a plugin from this manager.
namedPlugin | the plugin to remove |
Definition at line 134 of file PluginManager.h.
|
inline |
Remove a plugin from this manager.
namedPlugin | the plugin to remove |
Definition at line 134 of file PluginManager.h.
|
inline |
Remove a plugin from this manager.
pluginID | the ID of the plugin to remove |
Definition at line 140 of file PluginManager.h.
|
inline |
Remove a plugin from this manager.
pluginID | the ID of the plugin to remove |
Definition at line 140 of file PluginManager.h.
|
protected |
Definition at line 156 of file PluginManager.h.
|
protected |
Definition at line 155 of file PluginManager.h.
|
protected |
Definition at line 147 of file PluginManager.h.
|
protected |
Definition at line 149 of file PluginManager.h.
|
protected |
Definition at line 143 of file PluginManager.h.
|
protected |
Definition at line 153 of file PluginManager.h.
|
protected |
Definition at line 145 of file PluginManager.h.