| Elektra 0.11.0

Public Member Functions | Public Attributes | List of all members
kdb::tools::MockPluginDatabase Class Reference

A plugin database that works with added fake data. More...

`#include <plugindatabase.hpp>`

Inheritance diagram for kdb::tools::MockPluginDatabase:

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

## Public Attributes
std::unordered_map< PluginSpec, std::unordered_map< std::string, std::string >, PluginSpecHash, PluginSpecName > | data
| only data from here will be returned

## Additional Inherited Members
Public Types inherited from kdb::tools::PluginDatabase
enum | Status { provides , real , missing }
Static Public Member Functions inherited from kdb::tools::PluginDatabase
static int | calculateStatus (std::string statusString)

## Detailed Description

A plugin database that works with added fake data.

## Member Function Documentation

## ◆ getSymbol()

PluginDatabase::func_t kdb::tools::MockPluginDatabase::getSymbol | ( | PluginSpec const & | whichplugin,
|  | std::string const & | which
| ) |  | const
| 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

Implements kdb::tools::PluginDatabase.

## ◆ listAllPlugins()

std::vector< std::string > kdb::tools::MockPluginDatabase::listAllPlugins | ( |  | ) | const
| 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

Implements kdb::tools::PluginDatabase.

## ◆ lookupInfo()

std::string kdb::tools::MockPluginDatabase::lookupInfo | ( | PluginSpec const & | whichplugin,
|  | std::string const & | which
| ) |  | const
| 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

Implements kdb::tools::PluginDatabase.

## Member Data Documentation

## ◆ data

std::unordered_map<PluginSpec, std::unordered_map<std::string, std::string>, PluginSpecHash, PluginSpecName> kdb::tools::MockPluginDatabase::data
| mutable

only data from here will be returned

Note
  that it is ordered by name, i.e., different ref-names cannot be distinguished

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

- plugindatabase.hpp
- plugindatabase.cpp