This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

template<class T>
Corrade::PluginManager::Manager class

Plugin manager.

Manages loading, instancing and unloading plugins. See also Plugin management.

Base classes

class AbstractManager
Non-templated base class of Manager.

Constructors, destructors, conversion operators

Manager(std::string pluginDirectory = {}) explicit
Constructor.

Public functions

auto instance(const std::string& plugin) -> std::unique_ptr<T>
Plugin instance.
auto loadAndInstantiate(const std::string& plugin) -> std::unique_ptr<T>
Load and instantiate plugin.

Function documentation

template<class T>
Corrade::PluginManager::Manager<T>::Manager(std::string pluginDirectory = {}) explicit

Constructor.

Parameters
pluginDirectory Directory where plugins will be searched, encoded in UTF-8. No recursive processing is done.

First goes through list of static plugins and finds ones that use the same interface as this manager instance. Then gets list of all dynamic plugins in given directory.

template<class T>
std::unique_ptr<T> Corrade::PluginManager::Manager<T>::instance(const std::string& plugin)

Plugin instance.

Returns new instance of given plugin. The plugin must be already successfully loaded by this manager. The returned value is never nullptr.

template<class T>
std::unique_ptr<T> Corrade::PluginManager::Manager<T>::loadAndInstantiate(const std::string& plugin)

Load and instantiate plugin.

Convenience alternative to calling both load() and instance(). If loading fails, nullptr is returned.