Open Lighting Architecture
0.10.4
|
The manager of plugins.
The plugin manager is responsible for loading the plugins (via PluginLoaders) and retains ownership of the Plugin objects.
Each plugin has a numeric ID associated with it. The plugin IDs can be found in common/protocol/Ola.proto
Plugins can be disabled through the preferences file. Some plugins may conflict with others, in this case the first plugin will be started and the rest of the conflicting plugins are ignored.
Plugins are active if they weren't disabled, there were no conflicts that prevented them from loading, and the call to Start() was successfull.
Public Member Functions | |
PluginManager (const std::vector< PluginLoader * > &plugin_loaders, PluginAdaptor *plugin_adaptor) | |
Create a new PluginManager. More... | |
~PluginManager () | |
Destructor. | |
void | LoadAll () |
Attempt to load all the plugins and start them. More... | |
void | UnloadAll () |
void | Plugins (std::vector< AbstractPlugin * > *plugins) const |
Return the list of loaded plugins. More... | |
void | ActivePlugins (std::vector< AbstractPlugin * > *plugins) const |
Return a list of active plugins. More... | |
void | EnabledPlugins (std::vector< AbstractPlugin * > *plugins) const |
Return a list of enabled plugins. More... | |
AbstractPlugin * | GetPlugin (ola_plugin_id plugin_id) const |
Lookup a plugin by ID. More... | |
bool | IsActive (ola_plugin_id plugin_id) const |
Check if a plugin is active. More... | |
bool | IsEnabled (ola_plugin_id plugin_id) const |
Check if a plugin is enabled. More... | |
bool | EnableAndStartPlugin (ola_plugin_id plugin_id) |
Enable & start a plugin. More... | |
void | DisableAndStopPlugin (ola_plugin_id plugin_id) |
Disable & stop a plugin. More... | |
void | GetConflictList (ola_plugin_id plugin_id, std::vector< AbstractPlugin * > *plugins) |
Return a list of plugins that conflict with this particular plugin. More... | |
ola::PluginManager::PluginManager | ( | const std::vector< PluginLoader * > & | plugin_loaders, |
PluginAdaptor * | plugin_adaptor | ||
) |
Create a new PluginManager.
plugin_loaders | the list of PluginLoader to use. |
plugin_adaptor | the PluginAdaptor to pass to each plugin. |
void ola::PluginManager::ActivePlugins | ( | std::vector< AbstractPlugin * > * | plugins | ) | const |
Return a list of active plugins.
[out] | plugins | the list of active plugins. |
void ola::PluginManager::DisableAndStopPlugin | ( | ola_plugin_id | plugin_id | ) |
Disable & stop a plugin.
plugin_id | the id of the plugin to stop. |
bool ola::PluginManager::EnableAndStartPlugin | ( | ola_plugin_id | plugin_id | ) |
Enable & start a plugin.
plugin_id | the id of the plugin to start. |
This call will enable a plugin, but may not start it due to conflicts with existing plugins.
void ola::PluginManager::EnabledPlugins | ( | std::vector< AbstractPlugin * > * | plugins | ) | const |
Return a list of enabled plugins.
[out] | plugins | the list of enabled plugins. |
void ola::PluginManager::GetConflictList | ( | ola_plugin_id | plugin_id, |
std::vector< AbstractPlugin * > * | plugins | ||
) |
Return a list of plugins that conflict with this particular plugin.
plugin_id | the id of the plugin to check. | |
[out] | plugins | the list of plugins that conflict with this one. |
AbstractPlugin * ola::PluginManager::GetPlugin | ( | ola_plugin_id | plugin_id | ) | const |
Lookup a plugin by ID.
plugin_id | the id of the plugin to find. |
bool ola::PluginManager::IsActive | ( | ola_plugin_id | plugin_id | ) | const |
Check if a plugin is active.
plugin_id | the id of the plugin to check. |
bool ola::PluginManager::IsEnabled | ( | ola_plugin_id | plugin_id | ) | const |
Check if a plugin is enabled.
plugin_id | the id of the plugin to check. |
void ola::PluginManager::LoadAll | ( | ) |
Attempt to load all the plugins and start them.
Some plugins may not be started due to conflicts or being disabled.
void ola::PluginManager::Plugins | ( | std::vector< AbstractPlugin * > * | plugins | ) | const |
Return the list of loaded plugins.
[out] | plugins | the list of plugins. |
This list includes disabled and conflicting plugins.
void ola::PluginManager::UnloadAll | ( | ) |
Unload all the plugins.