Ignition Common

API Reference

4.5.0
PluginLoader Class Reference

Class for loading plugins. More...

#include <PluginLoader.hh>

Public Member Functions

 PluginLoader ()
 Constructor. More...
 
 ~PluginLoader ()
 Destructor. More...
 
PluginPtr Instantiate (const std::string &_pluginName) const
 Instantiates a plugin for the given plugin name. More...
 
template<typename PluginPtrType >
PluginPtrType Instantiate (const std::string &_pluginName) const
 Instantiates a plugin of PluginType for the given plugin name. This can be used to create a specialized PluginPtr. More...
 
std::unordered_set< std::stringInterfacesImplemented () const
 Get names of interfaces that the loader has plugins for. More...
 
std::unordered_set< std::stringLoadLibrary (const std::string &_pathToLibrary)
 Load a library at the given path. More...
 
std::unordered_set< std::stringPluginsImplementing (const std::string &_interface) const
 Get plugin names that implement the interface. More...
 
std::string PrettyStr () const
 Makes a printable string with info about plugins. More...
 

Detailed Description

Class for loading plugins.

Constructor & Destructor Documentation

◆ PluginLoader()

Constructor.

◆ ~PluginLoader()

Destructor.

Member Function Documentation

◆ Instantiate() [1/2]

PluginPtr Instantiate ( const std::string _pluginName) const

Instantiates a plugin for the given plugin name.

Parameters
[in]_pluginname of the plugin to instantiate
Returns
Pointer to instantiated plugin

◆ Instantiate() [2/2]

PluginPtrType Instantiate ( const std::string _pluginName) const

Instantiates a plugin of PluginType for the given plugin name. This can be used to create a specialized PluginPtr.

Template Parameters
PluginPtrTypeThe specialized type of PluginPtrPtr that you want to construct.
Parameters
[in]_pluginNameThe name of the plugin that you want to instantiate
Returns
pointer for the instantiated PluginPtr

◆ InterfacesImplemented()

std::unordered_set<std::string> InterfacesImplemented ( ) const

Get names of interfaces that the loader has plugins for.

Returns
Interfaces that are implemented

◆ LoadLibrary()

std::unordered_set<std::string> LoadLibrary ( const std::string _pathToLibrary)

Load a library at the given path.

Parameters
[in]_pathToLibraryis the path to a libaray
Returns
The set of plugins that have been loaded from the library

◆ PluginsImplementing()

std::unordered_set<std::string> PluginsImplementing ( const std::string _interface) const

Get plugin names that implement the interface.

Parameters
[in]_interfaceName of an interface
Returns
Names of plugins that implement the interface

◆ PrettyStr()

std::string PrettyStr ( ) const

Makes a printable string with info about plugins.

Returns
A pretty string

The documentation for this class was generated from the following file: