Open Lighting Architecture: ola::PluginManager Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::PluginManager Class Reference

## Detailed Description

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 successful.

## Public Member Functions
| PluginManager (const std::vector< PluginLoader * > &plugin_loaders, PluginAdaptor *plugin_adaptor)
| Create a new PluginManager.
| ~PluginManager ()
| Destructor.
void | LoadAll ()
| Attempt to load all the plugins and start them.
void | UnloadAll ()
void | Plugins (std::vector< AbstractPlugin * > *plugins) const
| Return the list of loaded plugins.
void | ActivePlugins (std::vector< AbstractPlugin * > *plugins) const
| Return a list of active plugins.
void | EnabledPlugins (std::vector< AbstractPlugin * > *plugins) const
| Return a list of enabled plugins.
AbstractPlugin * | GetPlugin (ola_plugin_id plugin_id) const
| Lookup a plugin by ID.
bool | IsActive (ola_plugin_id plugin_id) const
| Check if a plugin is active.
bool | IsEnabled (ola_plugin_id plugin_id) const
| Check if a plugin is enabled.
bool | EnableAndStartPlugin (ola_plugin_id plugin_id)
| Enable & start a plugin.
void | DisableAndStopPlugin (ola_plugin_id plugin_id)
| Disable & stop a plugin.
void | GetConflictList (ola_plugin_id plugin_id, std::vector< AbstractPlugin * > *plugins)
| Return a list of plugins that conflict with this particular plugin.

## Constructor & Destructor Documentation

## ◆ PluginManager()

ola::PluginManager::PluginManager | ( | const std::vector< PluginLoader * > & | plugin_loaders,
|  | PluginAdaptor * | plugin_adaptor )

Create a new PluginManager.

Parameters

  plugin_loaders | the list of PluginLoader to use.
  plugin_adaptor | the PluginAdaptor to pass to each plugin.

## Member Function Documentation

## ◆ ActivePlugins()

void ola::PluginManager::ActivePlugins | ( | std::vector< AbstractPlugin * > * | plugins | ) | const

Return a list of active plugins.

Parameters

  [out] | plugins | the list of active plugins.

## ◆ DisableAndStopPlugin()

void ola::PluginManager::DisableAndStopPlugin | ( | ola_plugin_id | plugin_id | ) |

Disable & stop a plugin.

Parameters

  plugin_id | the id of the plugin to stop.

## ◆ EnableAndStartPlugin()

bool ola::PluginManager::EnableAndStartPlugin | ( | ola_plugin_id | plugin_id | ) |

Enable & start a plugin.

Parameters

  plugin_id | the id of the plugin to start.

Returns
  true if the plugin was started or was already running, false if it couldn't be started.

This call will enable a plugin, but may not start it due to conflicts with existing plugins.

## ◆ EnabledPlugins()

void ola::PluginManager::EnabledPlugins | ( | std::vector< AbstractPlugin * > * | plugins | ) | const

Return a list of enabled plugins.

Parameters

  [out] | plugins | the list of enabled plugins.

## ◆ GetConflictList()

void ola::PluginManager::GetConflictList | ( | ola_plugin_id | plugin_id,
|  | std::vector< AbstractPlugin * > * | plugins )

Return a list of plugins that conflict with this particular plugin.

Parameters

  | plugin_id | the id of the plugin to check.
  [out] | plugins | the list of plugins that conflict with this one.

## ◆ GetPlugin()

AbstractPlugin * ola::PluginManager::GetPlugin | ( | ola_plugin_id | plugin_id | ) | const

Lookup a plugin by ID.

Parameters

  plugin_id | the id of the plugin to find.

Returns
  the plugin matching the id or NULL if not found.

## ◆ IsActive()

bool ola::PluginManager::IsActive | ( | ola_plugin_id | plugin_id | ) | const

Check if a plugin is active.

Parameters

  plugin_id | the id of the plugin to check.

Returns
  true if the plugin is active, false otherwise.

## ◆ IsEnabled()

bool ola::PluginManager::IsEnabled | ( | ola_plugin_id | plugin_id | ) | const

Check if a plugin is enabled.

Parameters

  plugin_id | the id of the plugin to check.

Returns
  true if the plugin is enabled, false otherwise.

## ◆ LoadAll()

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.

## ◆ Plugins()

void ola::PluginManager::Plugins | ( | std::vector< AbstractPlugin * > * | plugins | ) | const

Return the list of loaded plugins.

Parameters

  [out] | plugins | the list of plugins.

This list includes disabled and conflicting plugins.

## ◆ UnloadAll()

void ola::PluginManager::UnloadAll | ( |  | ) |

Unload all the plugins.

The documentation for this class was generated from the following files:

- olad/PluginManager.h
- olad/PluginManager.cpp