Specifies a plugin by its name and configuration.
More...
#include <pluginspec.hpp>
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)
◆ PluginSpec() [1/3]
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()
◆ PluginSpec() [2/3]
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()
◆ PluginSpec() [3/3]
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()
◆ appendConfig()
void kdb::tools::PluginSpec::appendConfig |
( |
KeySet |
c | ) |
|
Append to config.
- Parameters
-
◆ getConfig()
KeySet kdb::tools::PluginSpec::getConfig |
( |
| ) |
const |
◆ getFullName()
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
◆ getName()
std::string kdb::tools::PluginSpec::getName |
( |
| ) |
const |
◆ getRefName()
std::string kdb::tools::PluginSpec::getRefName |
( |
| ) |
const |
- Returns
- the reference name
◆ isRefNumber()
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 |
◆ setConfig()
void kdb::tools::PluginSpec::setConfig |
( |
KeySet |
c | ) |
|
Set plugin config.
- Parameters
-
c | new config to be used as plugin config |
◆ setFullName()
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
-
◆ setName()
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
-
◆ setRefName()
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
-
◆ setRefNumber()
void kdb::tools::PluginSpec::setRefNumber |
( |
size_t |
refnumber | ) |
|
Set a number for automatic references during parsing.
- Parameters
-
refnumber | the number to set |
◆ validate()
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
-
The documentation for this class was generated from the following files: