Elektra: kdb::tools::PluginDatabase Class Reference

Elektra 0.8.24

Public Types | Public Member Functions | Static Public Member Functions | List of all members
kdb::tools::PluginDatabase Class Referenceabstract

Loads all plugins and allows us to query them. More...

`#include <plugindatabase.hpp>`

Inherited by kdb::tools::ModulesPluginDatabase.

## Public Types
enum | Status { provides, real, missing }

## Public Member Functions
virtual std::vector< std::string > | listAllPlugins () const =0
| list all plugins More...
virtual std::string | lookupInfo (PluginSpec const &whichplugin, std::string const &which) const =0
| lookup contract clauses or dynamic information More...
virtual func_t | getSymbol (PluginSpec const &whichplugin, std::string const &which) const =0
| get exported plugin symbol More...
virtual PluginSpec | lookupMetadata (std::string const &which) const =0
| lookup which plugin handles metadata More...
virtual PluginSpec | lookupProvides (std::string const &provides) const =0
| lookup which plugin is a provider for that plugin More...
virtual std::map< int, PluginSpec > | lookupAllProvidesWithStatus (std::string const &provides) const =0
| looks up all plugins which are a suitable provider More...
virtual std::vector< PluginSpec > | lookupAllProvides (std::string const &provides) const =0
| looks up all plugins which are a suitable provider More...

## Static Public Member Functions
static int | calculateStatus (std::string statusString)

## Detailed Description

Loads all plugins and allows us to query them.

## Member Enumeration Documentation

## ◆ Status

enum kdb::tools::PluginDatabase::Status

Enumerator
provides | does not directly, but can be loaded via provides
real | exists and working as given
missing | does not exist or cannot be loaded

## Member Function Documentation

## ◆ calculateStatus()

int kdb::tools::PluginDatabase::calculateStatus | ( | std::string | statusString | ) |
| static

Parameters

  statusString | the string encoding the status

Returns
  The representing number for a given status.

## ◆ getSymbol()

virtual func_t kdb::tools::PluginDatabase::getSymbol | ( | PluginSpec const & | whichplugin,
|  | std::string const & | which
| ) |  | const
| pure virtual

get exported plugin symbol

Parameters

  whichplugin | from which plugin?
  which | which symbol would you like to look up?

Returns
  the function pointer to the exported symbol or NULL if the symbol was not found

Implemented in kdb::tools::MockPluginDatabase, and kdb::tools::ModulesPluginDatabase.

## ◆ listAllPlugins()

virtual std::vector<std::string> kdb::tools::PluginDatabase::listAllPlugins | ( |  | ) | const
| pure virtual

list all plugins

If Elektra is compiled with plugins, it will search for shared libraries. In any case, if no shared libraries were found it will fallback to an internal list (plugins that were compiled together with Elektra).

Returns
  a list of all available plugins

Implemented in kdb::tools::MockPluginDatabase, and kdb::tools::ModulesPluginDatabase.

## ◆ lookupAllProvides()

virtual std::vector<PluginSpec> kdb::tools::PluginDatabase::lookupAllProvides | ( | std::string const & | provides | ) | const
| pure virtual

looks up all plugins which are a suitable provider

Note
  in case a plugin name is provided, the plugin with the name will also be part of the result. But if there are other plugins providing the requirement, then they will also be part of the result. The ordering of the resulting vector has no special meaning.

Parameters

  provides | is the provider to find

Returns
  a vector of plugins offering the requirement or are named after it

Implemented in kdb::tools::ModulesPluginDatabase.

## ◆ lookupAllProvidesWithStatus()

virtual std::map<int, PluginSpec> kdb::tools::PluginDatabase::lookupAllProvidesWithStatus | ( | std::string const & | provides | ) | const
| pure virtual

looks up all plugins which are a suitable provider

Note
  in case a plugin name is provided, the plugin with the name will also be part of the result. But if there are other plugins providing the requirement, then they will also be part of the result.

Parameters

  provides | is the provider to find

Returns
  a map of plugins with their status offering the requirement or are named after it

Implemented in kdb::tools::ModulesPluginDatabase.

## ◆ lookupInfo()

virtual std::string kdb::tools::PluginDatabase::lookupInfo | ( | PluginSpec const & | whichplugin,
|  | std::string const & | which
| ) |  | const
| pure virtual

lookup contract clauses or dynamic information

Parameters

  whichplugin | about which plugin?
  which | about which clause in the contract?

Returns
  the clause of the contract

Implemented in kdb::tools::MockPluginDatabase, and kdb::tools::ModulesPluginDatabase.

## ◆ lookupMetadata()

virtual PluginSpec kdb::tools::PluginDatabase::lookupMetadata | ( | std::string const & | which | ) | const
| pure virtual

lookup which plugin handles metadata

Parameters

  which | the metadata of interest

Returns
  the best suited plugin specification which provides it

Implemented in kdb::tools::ModulesPluginDatabase.

## ◆ lookupProvides()

virtual PluginSpec kdb::tools::PluginDatabase::lookupProvides | ( | std::string const & | provides | ) | const
| pure virtual

lookup which plugin is a provider for that plugin

Note
  will return a PluginSpec with getName() == provides if the string provides actually is a plugin name.

Parameters

  provides | is the provider to find

Exceptions

  NoPlugin | if no plugin that provides the functionality could be found

Returns
  the plugin itself or the best suited plugin specification which provides it

Implemented in kdb::tools::ModulesPluginDatabase.

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

- plugindatabase.hpp
- plugindatabase.cpp