Albert
Loading...
Searching...
No Matches
albert::PluginLoader Class Referenceabstract

#include <albert/pluginloader.h>

Inherits QObject.

Detailed Description

Asynchronous plugin loader turning a physical plugin into a logical PluginInstance.

Signals

void finished (QString info)
 Emitted when the loading process finished.
 

Public Member Functions

virtual QString path () const =0
 Returns the path to the plugin.
 
virtual const PluginMetadatametadata () const =0
 Returns the plugin metadata.
 
virtual void load ()=0
 Starts loading the plugin.
 
virtual void unload ()=0
 Unloads the plugin.
 
virtual albert::PluginInstanceinstance ()=0
 Returns the PluginInstance if the plugin is loaded, else nullptr.
 

Static Public Attributes

static thread_local PluginLoadercurrent_loader
 Used to set the plugin loader while plugin instatiation.
 

Protected Member Functions

virtual ~PluginLoader ()
 

Constructor & Destructor Documentation

◆ ~PluginLoader()

virtual albert::PluginLoader::~PluginLoader ( )
protectedvirtual

Member Function Documentation

◆ finished

void albert::PluginLoader::finished ( QString  info)
signal

Emitted when the loading process finished.

On success instance() returns a valid PluginInstance. info contains additional information about the finished loading proc instance() returns a nullptr, i.e. the plugin failed to load, info is interpreted as error message.

◆ instance()

virtual albert::PluginInstance * albert::PluginLoader::instance ( )
pure virtual

Returns the PluginInstance if the plugin is loaded, else nullptr.

◆ load()

virtual void albert::PluginLoader::load ( )
pure virtual

Starts loading the plugin.

See also
current_loader

◆ metadata()

virtual const PluginMetadata & albert::PluginLoader::metadata ( ) const
pure virtual

Returns the plugin metadata.

◆ path()

virtual QString albert::PluginLoader::path ( ) const
pure virtual

Returns the path to the plugin.

◆ unload()

virtual void albert::PluginLoader::unload ( )
pure virtual

Unloads the plugin.

Member Data Documentation

◆ current_loader

thread_local PluginLoader* albert::PluginLoader::current_loader
static

Used to set the plugin loader while plugin instatiation.

This avoids injection mechanisms and therefore reduces boilerplate for PluginInstance implementations. Implementations have to set this before calling the constructor of the plugin instance.


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