Open Lighting Architecture  0.9.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 successfull.

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.
AbstractPluginGetPlugin (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.
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

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

Create a new PluginManager.

Parameters
plugin_loadersthe list of PluginLoader to use.
plugin_adaptorthe PluginAdaptor to pass to each plugin.

Member Function Documentation

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

Return a list of active plugins.

Parameters
[out]pluginsthe list of active 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.

Parameters
plugin_idthe id of the plugin to check.
[out]pluginsthe list of plugins that conflict with this one.
AbstractPlugin * ola::PluginManager::GetPlugin ( ola_plugin_id  plugin_id) const

Lookup a plugin by ID.

Parameters
plugin_idthe id of the plugin to find.
Returns
the plugin matching the id or NULL if not found.
bool ola::PluginManager::IsActive ( ola_plugin_id  plugin_id) const

Check if a plugin is active.

Parameters
plugin_idthe id of the plugin to check.
Returns
true if the plugin is active, false otherwise.
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.

Parameters
[out]pluginsthe list of plugins.

This list includes disabled and conflicting plugins.

void ola::PluginManager::UnloadAll ( )

Unload all the plugins.


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