Editor API
UnigineEditor public API
Editor::PluginManager Class Referencefinal

The Editor::PluginManager is the main controller class of the Plugin System, it is responsible for:

More...

#include <PluginManager.h>

Inheritance diagram for Editor::PluginManager:

Signals

void initializationCompleted ()
 This signal is emitted when the PluginManager initialization is completed (i.e. all plugins from the loading queue are loaded and initialized). More...
 

Static Public Member Functions

static PluginManagerinstance ()
 Returns the instance of the PluginManager class. This method is used to subscribe to signals. More...
 
static void loadPluginSpecs (const QVector< QString > &search_paths)
 Loads specifications for all plugins found in the specified directories and tries to read all plugins metadata and resolve all dependencies (change the state of all PluginInfo instances from INVALID to RESOLVED). This method builds the list of all available plugins. More...
 
static void loadPlugins ()
 Loads and initializes all available plugins from the list generated by calling the loadPluginSpecs() method (PluginInfo states LOADED and RUNNING). More...
 
static void unloadPlugins ()
 Destroys all currently loaded plugins and unloads dynamic libraries from memory (PluginInfo states STOPPED and UNLOADED). More...
 
static QVector< PluginInfo * > plugins ()
 Returns information on all plugins currently available as a vector of PluginInfo items containing all necessary information on each plugin. More...
 
static bool hasError ()
 Returns true if at least one error has occurred when loading any of the plugins available. If the result is positive, you can use the allErrors() method to get detailed information on all errors. More...
 
static QVector< QString > allErrors ()
 Returns detailed information on all plugin errors accurred as a vector of strings (one string per error). More...
 
static bool isInitialized ()
 Returns a value indicating if the PluginManager is initialized successfully (i.e. all plugins from the loading queue are loaded and initialized). More...
 

Friends

class Editor::Application
 

Detailed Description

The Editor::PluginManager is the main controller class of the Plugin System, it is responsible for:

  • Locating dynamic libraries in folders specified by the user.
  • Plugins initialization their lifecycle management and destruction via the instances of PluginInfo class.
  • Building plugins loading queue, as the order in which the plugins are loaded is important. If a plugin has a required dependency it expects for certain symbols to be loaded.
  • Providing the user with information on plugins. Currently used to build target UI in the Editor.

Member Function Documentation

◆ allErrors()

static QVector<QString> Editor::PluginManager::allErrors ( )
static

Returns detailed information on all plugin errors accurred as a vector of strings (one string per error).

◆ hasError()

static bool Editor::PluginManager::hasError ( )
static

Returns true if at least one error has occurred when loading any of the plugins available. If the result is positive, you can use the allErrors() method to get detailed information on all errors.

◆ initializationCompleted

void Editor::PluginManager::initializationCompleted ( )
signal

This signal is emitted when the PluginManager initialization is completed (i.e. all plugins from the loading queue are loaded and initialized).

◆ instance()

static PluginManager* Editor::PluginManager::instance ( )
static

Returns the instance of the PluginManager class. This method is used to subscribe to signals.

Returns
PluginManager class instance.

Example:

, this, &SomeClass::plugin_manager_initialized);

◆ isInitialized()

static bool Editor::PluginManager::isInitialized ( )
static

Returns a value indicating if the PluginManager is initialized successfully (i.e. all plugins from the loading queue are loaded and initialized).

Returns
true if the PluginManager was successfully initialized; otherwise, false.

◆ loadPlugins()

static void Editor::PluginManager::loadPlugins ( )
static

Loads and initializes all available plugins from the list generated by calling the loadPluginSpecs() method (PluginInfo states LOADED and RUNNING).

◆ loadPluginSpecs()

static void Editor::PluginManager::loadPluginSpecs ( const QVector< QString > &  search_paths)
static

Loads specifications for all plugins found in the specified directories and tries to read all plugins metadata and resolve all dependencies (change the state of all PluginInfo instances from INVALID to RESOLVED). This method builds the list of all available plugins.

Parameters
search_pathsList of directories to look for plugin binary files in.

◆ plugins()

static QVector<PluginInfo *> Editor::PluginManager::plugins ( )
static

Returns information on all plugins currently available as a vector of PluginInfo items containing all necessary information on each plugin.

◆ unloadPlugins()

static void Editor::PluginManager::unloadPlugins ( )
static

Destroys all currently loaded plugins and unloads dynamic libraries from memory (PluginInfo states STOPPED and UNLOADED).

Friends And Related Function Documentation

◆ Editor::Application

friend class Editor::Application
friend