Managing Plugins with Plugify
The plugin manager in Plugify plays a crucial role in handling the loading, initialization, and termination of plugins. Here's how you can control the plugin manager effectively:
Initializing the Plugin Manager
Initialize the plugin manager after a successful initialization of the package manager. The plugin manager relies on information about local packages obtained from the package manager:
auto pluginManager = plugifyProvider.GetPluginManager();
if (pluginManager.Initialize()) {
} else {
}
Loading and Unloading Plugins
The plugin manager in Plugify has specific characteristics regarding loading and unloading:
- Initialization:
- The plugin manager can be initialized only if the package manager initialization was successful.
- Load and Unload Operations:
- The plugin manager does not support the individual loading and unloading of plugins after initialization.
- To update the plugins, unload the entire plugin manager and initialize it again.
Starting and Ending Plugins
- Initialization Order:
- During initialization, the plugin manager sorts plugins by dependencies using topological sorting to ensure correct initialization order.
- Startup and Termination:
- Plugins are started after initialization, ensuring a smooth startup sequence.
- When terminating the plugin manager, it ends plugins in reverse order of loading.