Holds a registry of plugins, loading and compiling them on the fly.
More...
#include <Plugin.h>
|
| enum class | LoadMode {
Load = 0
,
Reload = 1
} |
| | Instructs loadPlugin to Load or Reload the plugin. More...
|
| |
Holds a registry of plugins, loading and compiling them on the fly.
◆ LoadMode
Instructs loadPlugin to Load or Reload the plugin.
◆ close()
| Result SC::PluginRegistry::close |
( |
| ) |
|
◆ findPlugin()
◆ getIdentifierAt()
| const PluginIdentifier & SC::PluginRegistry::getIdentifierAt |
( |
size_t | index | ) |
const |
|
inlinenodiscard |
Returns the PluginIdentifier corresponding to the index entry of the registry.
◆ getNumberOfEntries()
| size_t SC::PluginRegistry::getNumberOfEntries |
( |
| ) |
const |
|
inlinenodiscard |
Returns the total number of registry entries (counting both loaded and unloaded plugins)
◆ getPluginDynamicLibraryAt()
Returns the PluginIdentifier corresponding to the index entry of the registry.
◆ getPluginsToReloadBecauseOf()
| void SC::PluginRegistry::getPluginsToReloadBecauseOf |
( |
StringSpan | relativePath, |
|
|
TimeMs | tolerance, |
|
|
Function< void(const PluginIdentifier &)> | onPlugin ) |
Enumerates all plugins that must be reloaded when relativePath is modified.
- Parameters
-
| relativePath | A relative path of the file that has been modified |
| tolerance | How many milliseconds must be passed to consider a file as modified |
| onPlugin | Callback that will be called with Plugins affected by the modification |
◆ init()
◆ loadPlugin()
| Result SC::PluginRegistry::loadPlugin |
( |
StringSpan | identifier, |
|
|
const PluginCompiler & | compiler, |
|
|
const PluginSysroot & | sysroot, |
|
|
StringSpan | executablePath, |
|
|
LoadMode | loadMode = LoadMode::Load ) |
Loads a plugin with given identifier, compiling it with given PluginCompiler.
- Parameters
-
| 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 |
- Returns
- Valid Result if the plugin has been found, compiled, loaded and inited successfully
◆ removeAllBuildProducts()
| Result SC::PluginRegistry::removeAllBuildProducts |
( |
StringSpan | identifier | ) |
|
Removes all temporary build products of the Plugin with given identifier.
- Parameters
-
| identifier | Identifier of the plugin |
- Returns
- Valid Result if all build products for the given plugin can be successfully removed
◆ replaceDefinitions()
| Result SC::PluginRegistry::replaceDefinitions |
( |
Span< PluginDefinition > && | definitions | ) |
|
Appends the definitions to registry.
- Parameters
-
| definitions | found plugin definitions |
- Returns
- Valid Result if definitions have been replaced successfully
◆ unloadPlugin()
| Result SC::PluginRegistry::unloadPlugin |
( |
StringSpan | identifier | ) |
|
Unloads an already loaded plugin by its identifier.
- Parameters
-
| identifier | Identifier of a plugin that must be unloaded |
- Returns
- Valid Result if an already loaded plugin exists with the given identifier and it can be unloaded
The documentation for this struct was generated from the following file: