Corrade::PluginManager::PluginMetadata class

Plugin metadata.

This class stores metadata about a particular plugin. The plugin metadata are stored in a plugin metadata file, which resides either besides the dynamic plugin binary in a filesystem or is compiled directly into executable with a static plugin. See Plugin management for a tutorial and brief introduction to how plugins work.

The plugin metadata file has a simple INI-like syntax (see Utility::Configuration class documentation for full specification). The file stores list of dependencies (if the plugin depends on another), list of aliases and optionally plugin-specific data and configuration. Example Matrix.conf file for a Matrix plugin:

# Dependencies

# Aliases

# Optional plugin-specific data
description=My first matrix without bugs

# Optional plugin-specific configuration

According to the configuration file, the Matrix plugin can be loaded only if SomeRandomJohnDoesPlugin, BaseMatrixPlugin and SkyNetPlugin are found can be loaded. It will be also loaded when requesting RealWorld plugin, but only if this is the first plugin providing it.

The [data] section can contain read-only data that can be used for example to provide additional info about the plugin in a user interface and is accessible through data().

The [configuration] section contains initial configuration data that can be modified by the user to setup a particular plugin instance beyond what's possible via the plugin interface. The initial configuration is accessible through configuration(), while a modifiable copy is stored in each plugin instance, accessible through AbstractPlugin::configuration().

Constructors, destructors, conversion operators

PluginMetadata(const PluginMetadata&) deleted
Copying is not allowed.
PluginMetadata(PluginMetadata&&) deleted
Moving is not allowed.

Public functions

auto operator=(const PluginMetadata&) -> PluginMetadata& deleted
Copying is not allowed.
auto operator=(PluginMetadata&&) -> PluginMetadata& deleted
Moving is not allowed.
auto name() const -> std::string
Plugin name.
auto depends() const -> const std::vector<std::string>&
Plugins on which this plugin depends.
auto usedBy() const -> std::vector<std::string>
Plugins which depend on this plugin.
auto provides() const -> const std::vector<std::string>&
Plugins which are provided by this plugin.
auto data() const -> const Utility::ConfigurationGroup&
Plugin-specific data.
auto configuration() -> Utility::ConfigurationGroup&
Initial plugin-specific configuration.
auto configuration() const -> const Utility::ConfigurationGroup&

Function documentation

const std::vector<std::string>& Corrade::PluginManager::PluginMetadata::depends() const

Plugins on which this plugin depends.

List of plugins which must be loaded before this plugin can be loaded.

std::vector<std::string> Corrade::PluginManager::PluginMetadata::usedBy() const

Plugins which depend on this plugin.

List of plugins which uses this plugin. This plugin cannot be unloaded when any of these plugins are loaded.

const std::vector<std::string>& Corrade::PluginManager::PluginMetadata::provides() const

Plugins which are provided by this plugin.

List of plugin names that are alias to this plugin when loading the plugin by name (not as dependency) if there is no plugin with that name. If there is more than one alias for given name, the first found is used.

const Utility::ConfigurationGroup& Corrade::PluginManager::PluginMetadata::data() const

Plugin-specific data.

Additional plugin-specific data, contained in the [data] group of plugin metadata. If the [data] group was not present in the metadata, the returned group is empty.

Utility::ConfigurationGroup& Corrade::PluginManager::PluginMetadata::configuration()

Initial plugin-specific configuration.

Initial plugin-specific configuration, contained in the [configuration] group of plugin configuration. A plugin-local copy is stored in each plugin instance, available through AbstractPlugin::configuration(). Changing the global configuration will affect all plugins instantiated with the same manager, resetting the configuration back can be done by recreating the manager.

If the [configuration] group was not present in the metadata, the returned group is empty.

const Utility::ConfigurationGroup& Corrade::PluginManager::PluginMetadata::configuration() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.