Scroll to navigation

kdb::tools::PluginSpec(3elektra) Elektra kdb::tools::PluginSpec(3elektra)

NAME

kdb::tools::PluginSpec - Specifies a plugin by its name and configuration.

SYNOPSIS

#include <pluginspec.hpp>

Public Member Functions


PluginSpec (std::string pluginName, KeySet pluginConfig=KeySet())
Construct a plugin spec with a given module name. PluginSpec (std::string pluginName, std::string refName, KeySet pluginConfig=KeySet())
Construct a plugin spec with a given module and ref name. PluginSpec (std::string pluginName, size_t refNumber, KeySet pluginConfig=KeySet())
Construct a plugin spec with a given module name and ref number. std::string getFullName () const
std::string getRefName () const
bool isRefNumber () const
Checks if reference name contains only numbers. std::string getName () const
KeySet getConfig () const
void setFullName (std::string const &name)
Set the full name with # or only the name. void setRefName (std::string const &name)
Set the reference name of the plugin. void setRefNumber (size_t number)
Set a number for automatic references during parsing. void setName (std::string const &name)
Set the module name of the plugin. void appendConfig (KeySet config)
Append to config. void setConfig (KeySet config)
Set plugin config. void validate (std::string const &str) const
Check if str starts with a-z and then only has chars a-z, 0-9 or underscore (_)

Detailed Description

Specifies a plugin by its name and configuration.

Invariant:

name is valid (nonempty, starts with a-z, then a-z_0-9)

refname is valid (same as above or a size_t number)

Constructor & Destructor Documentation

kdb::tools::PluginSpec::PluginSpec (std::string pluginName, KeySet pluginConfig = KeySet ()) [explicit]

Construct a plugin spec with a given module name.

Parameters:

pluginName the fullname (modulename # refname)
pluginConfig the plugins config

Exceptions:

BadPluginName if name not a-z

See also:

setFullName()

kdb::tools::PluginSpec::PluginSpec (std::string pluginName, std::string refName, KeySet pluginConfig = KeySet ()) [explicit]

Construct a plugin spec with a given module and ref name.

Parameters:

pluginName the module this plugin is instantiated from
refName for uniqueness for more plugins from one module
pluginConfig the plugins config

Exceptions:

BadPluginName if name not a-z

See also:

setName()

setRefName()

kdb::tools::PluginSpec::PluginSpec (std::string pluginName, size_t refNumber, KeySet pluginConfig = KeySet ()) [explicit]

Construct a plugin spec with a given module name and ref number.

Parameters:

pluginName the module this plugin is instantiated from
refNumber for uniqueness for more plugins from one module
pluginConfig the plugins config

Exceptions:

BadPluginName if name not a-z

See also:

setName()

setRefName()

Member Function Documentation

void kdb::tools::PluginSpec::appendConfig (KeySet c)

Append to config.

Parameters:

c config to append

KeySet kdb::tools::PluginSpec::getConfig () const

Returns:

the config

std::string kdb::tools::PluginSpec::getFullName () const

Note:

if no reference name is given its equal to the module name

Returns:

the module name, then #, and then the reference name

std::string kdb::tools::PluginSpec::getName () const

Returns:

the module name

std::string kdb::tools::PluginSpec::getRefName () const

Returns:

the reference name

bool kdb::tools::PluginSpec::isRefNumber () const

Checks if reference name contains only numbers.

Return values:

true if only numbers
true if a refname was given

void kdb::tools::PluginSpec::setConfig (KeySet c)

Set plugin config.

Parameters:

c new config to be used as plugin config

void kdb::tools::PluginSpec::setFullName (std::string const & n)

Set the full name with # or only the name.

Exceptions:

BadPluginName if name not a-z (no change then)

Parameters:

n the string to set

void kdb::tools::PluginSpec::setName (std::string const & n)

Set the module name of the plugin.

Exceptions:

BadPluginName if name not a-z (no change then)

Parameters:

n the string to set

void kdb::tools::PluginSpec::setRefName (std::string const & n)

Set the reference name of the plugin.

Exceptions:

BadPluginName if name not a-z (no change then)

Makes different plugins based from the same module unique.

Parameters:

n the string to set

void kdb::tools::PluginSpec::setRefNumber (size_t refnumber)

Set a number for automatic references during parsing.

Parameters:

refnumber the number to set

void kdb::tools::PluginSpec::validate (std::string const & n) const

Check if str starts with a-z and then only has chars a-z, 0-9 or underscore (_)

Parameters:

n the string to check

Author

Generated automatically by Doxygen for Elektra from the source code.

Mon Jan 15 2018 Version 0.8.20