![]() |
RobWorkProject
23.9.11-
|
The PluginRepository provides a container load methods for plugins. More...
#include <PluginRepository.hpp>
Public Types | |
typedef rw::core::Ptr< PluginRepository > | Ptr |
Smart pointer type for PluginRepository. | |
Public Member Functions | |
PluginRepository () | |
Constructs an empty repository. | |
~PluginRepository () | |
Destructor. | |
void | load (const std::string &filename) |
Loads in a PluginFactoryBase from a file. More... | |
void | loadFilesInFolder (const std::string &path, bool searchSubFolders) |
Attempts to load all dll files in folder. More... | |
void | addPlugin (PluginFactoryBase::Ptr plugin, bool force=false) |
this adds a plugin directly More... | |
const std::map< std::string, PluginFactoryBase::Ptr > & | getAllPlugins () const |
Returns map in which keys are the identifiers of loaded plugins factories and the value is the plugin factory. More... | |
std::map< std::string, PluginFactoryBase::Ptr > & | getAllPlugins () |
Returns map in which keys are the identifiers of loaded plugins factories and the value is the plugin factory. More... | |
template<class T > | |
std::vector< rw::core::Ptr< PluginFactory< T > > > | getPlugins () |
Returns all rw::core::PluginFactory<T> instances which matches the template argument T. More... | |
The PluginRepository provides a container load methods for plugins.
The PluginRepository contain a collection of pointers rw::plugin::PluginFactoryBase instances which can be used to create plugins.
The PluginRepository has a number of different methods to load plugins and methods for searching for a plugins either based on identifiers or by type.
void addPlugin | ( | PluginFactoryBase::Ptr | plugin, |
bool | force = false |
||
) |
this adds a plugin directly
This is especially usefull if you want to add plugin functionality statically avoiding dynamic loading or managing the dynamic loading your self.
plugin | [in] the plugin factory base |
force | [in] if true, an existing plugin with same identifier string will be replaced by the new plugin |
std::map<std::string, PluginFactoryBase::Ptr>& getAllPlugins | ( | ) |
Returns map in which keys are the identifiers of loaded plugins factories and the value is the plugin factory.
const std::map<std::string, PluginFactoryBase::Ptr>& getAllPlugins | ( | ) | const |
Returns map in which keys are the identifiers of loaded plugins factories and the value is the plugin factory.
|
inline |
Returns all rw::core::PluginFactory<T> instances which matches the template argument T.
void load | ( | const std::string & | filename | ) |
Loads in a PluginFactoryBase from a file.
If the file could not be loaded or does not contain an object of type PluginFactoryBase a rw::core::Exception is thrown.
filename | [in] File to load |
void loadFilesInFolder | ( | const std::string & | path, |
bool | searchSubFolders | ||
) |
Attempts to load all dll files in folder.
If finding a dll file which can not be loaded or does not contain an object of type PluginFactoryBase a rw::core::Exception is thrown.
path | [in] Path from which to attempt for load plugins |
searchSubFolders | [in] True to search recursively into subfolders. |