Holds a registry of plugins, loading and compiling them on the fly. More...
#include <Plugin.h>
Public Types | |
enum class | LoadMode { Load = 0 , Reload = 1 } |
Instructs loadPlugin to Load or Reload the plugin. More... | |
Public Member Functions | |
Result | replaceDefinitions (Vector< PluginDefinition > &&definitions) |
Appends the definitions to registry. More... | |
Result | loadPlugin (const StringView identifier, const PluginCompiler &compiler, const PluginSysroot &sysroot, StringView executablePath, LoadMode loadMode=LoadMode::Load) |
Loads a plugin with given identifier, compiling it with given PluginCompiler. More... | |
Result | unloadPlugin (const StringView identifier) |
Unloads an already loaded plugin by its identifier. More... | |
Result | removeAllBuildProducts (const StringView identifier) |
Removes all temporary build products of the Plugin with given identifier. More... | |
const PluginDynamicLibrary * | findPlugin (const StringView identifier) |
Find a PluginDynamicLibrary in the registry with a given identifier. More... | |
size_t | getNumberOfEntries () const |
Returns the total number of registry entries (counting both loaded and unloaded plugins) More... | |
const PluginIdentifier & | getIdentifierAt (size_t index) const |
Returns the PluginIdentifier corresponding to the index entry of the registry. More... | |
const PluginDynamicLibrary & | getPluginDynamicLibraryAt (size_t index) |
Returns the PluginIdentifier corresponding to the index entry of the registry. More... | |
Holds a registry of plugins, loading and compiling them on the fly.
|
strong |
Instructs loadPlugin to Load or Reload the plugin.
const PluginDynamicLibrary * SC::PluginRegistry::findPlugin | ( | const StringView | identifier | ) |
Find a PluginDynamicLibrary in the registry with a given identifier.
identifier | Identifier of the Plugin to find |
nullptr
)
|
inline |
Returns the PluginIdentifier corresponding to the index entry of the registry.
|
inline |
Returns the total number of registry entries (counting both loaded and unloaded plugins)
|
inline |
Returns the PluginIdentifier corresponding to the index entry of the registry.
Result SC::PluginRegistry::loadPlugin | ( | const StringView | identifier, |
const PluginCompiler & | compiler, | ||
const PluginSysroot & | sysroot, | ||
StringView | executablePath, | ||
LoadMode | loadMode = LoadMode::Load |
||
) |
Loads a plugin with given identifier, compiling it with given PluginCompiler.
identifier | The Plugin identifier that must be loaded |
compiler | The compiler used |
sysroot | The sysroot (library / include files) used |
executablePath | The loader executable path holding symbols used by the plugin |
loadMode | If to load or force reload of the plugin |
Result SC::PluginRegistry::removeAllBuildProducts | ( | const StringView | identifier | ) |
Removes all temporary build products of the Plugin with given identifier.
identifier | Identifier of the plugin |
Result SC::PluginRegistry::replaceDefinitions | ( | Vector< PluginDefinition > && | definitions | ) |
Appends the definitions to registry.
definitions | found plugin definitions |
Result SC::PluginRegistry::unloadPlugin | ( | const StringView | identifier | ) |
Unloads an already loaded plugin by its identifier.
identifier | Identifier of a plugin that must be unloaded |