Collection of elements to configure an algorithm. More...
#include <seqan3/core/configuration/configuration.hpp>
Public Member Functions | |
Constructor, destructor and assignment | |
constexpr | configuration ()=default |
Defaulted. | |
constexpr | configuration (configuration const &)=default |
Defaulted. | |
constexpr | configuration (configuration &&)=default |
Defaulted. | |
constexpr configuration & | operator= (configuration const &)=default |
Defaulted. | |
constexpr configuration & | operator= (configuration &&)=default |
Defaulted. | |
~configuration ()=default | |
Defaulted. | |
template<typename config_element_t > | |
constexpr | configuration (config_element_t &&config_element) |
Constructs a configuration from a single configuration element. More... | |
Capacity | |
constexpr size_t | size () const noexcept |
Returns the number of contained config elements. | |
![]() | |
T | operator= (T... args) |
T | swap (T... args) |
T | tuple (T... args) |
Friends | |
template<detail::config_element ... _configs_t> | |
class | configuration |
Friend declaration for other instances of the configuration. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename lhs_config_t , typename rhs_config_t > | |
constexpr auto | operator| (lhs_config_t &&lhs, rhs_config_t &&rhs) |
Combines two configurations and/or configuration elements forming a new seqan3::configuration. More... | |
Type deduction guides | |
template<detail::config_element config_t> | |
configuration (config_t) -> configuration< config_t > | |
Deduces the correct configuration element type from the passed seqan3::pipeable_config_element. | |
Tuple interface | |
template<template< typename ... > class query_t, typename ... configs_t> | |
constexpr auto & | get (configuration< configs_t... > &config) noexcept |
Returns the stored element. More... | |
Observers | |
template<typename alternative_t > | |
constexpr decltype(auto) | get_or (alternative_t &&alternative) &noexcept |
Returns the stored configuration element if present otherwise the given alternative. More... | |
template<typename alternative_t > | |
constexpr decltype(auto) | get_or (alternative_t &&alternative) const &noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename alternative_t > | |
constexpr decltype(auto) | get_or (alternative_t &&alternative) &&noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename alternative_t > | |
constexpr decltype(auto) | get_or (alternative_t &&alternative) const &&noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename query_t > | |
static constexpr bool | exists () noexcept |
Checks if the given type exists in the tuple. | |
template<template< typename ... > typename query_t> | |
static constexpr bool | exists () noexcept |
Checks if the given type exists in the tuple. | |
Modifiers | |
Note that modifications return new configurations and do not modify | |
template<typename other_configuration_t > | |
constexpr auto | append (other_configuration_t &&other_config) const |
Returns a new configuration by appending the given configuration to the current one. More... | |
template<typename query_t > | |
constexpr auto | remove () const |
Remove a config element from the configuration. More... | |
template<template< typename ... > typename query_t> | |
constexpr auto | remove () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Collection of elements to configure an algorithm.
configs_t | Template parameter pack containing all configuration elements; Must model seqan3::detail::config_element |
This class provides a unified interface to create and query such configurations for a specific algorithm. It extends the standard tuple interface with some useful functions to modify and query the user configurations.
|
no-apiinlineconstexpr |
Constructs a configuration from a single configuration element.
config_element_t | The configuration element to add; must model seqan3::detail::config_element. |
[in] | config_element | The configuration element to construct the configuration from. |
|
no-apiinlineconstexpr |
Returns a new configuration by appending the given configuration to the current one.
other_configuration_t | Another configuration type or configuration element type; each configuration element must model seqan3::detail::config_element_pipeable_with each of the configurations elements of the current configuration. |
[in] | other_config | The other configuration to append to the current one. |
This function generates a new configuration object containing the appended configuration elements. The current configuration will not be modified.
|
no-apiinlineconstexprnoexcept |
Returns the stored configuration element if present otherwise the given alternative.
alternative_t | The type of the configuration element that is queried. |
[in] | alternative | The alternative whose type is used to check for an existing configuration element. |
Uses the type alternative_t
of the given alternative to check if such an configuration element was already stored inside of the configuration. If no suitable candidate can be found the passed value alternative
will be returned. If alternative_t
is a class template, then any specialisation of this alternative type will be searched and returned if present.
alternative_t
or the alternative if not present.no-throw guarantee.
Constant time.
|
no-apiinlineconstexpr |
Remove a config element from the configuration.
query_t | The config element type to remove from the configuration. |
query_t
.
|
no-apirelated |
Combines two configurations and/or configuration elements forming a new seqan3::configuration.
lhs_config_t | The type of the left hand side operand; the seqan3::is_config_element_combineable_v variable template must evaluate to true for both operand types. |
rhs_config_t | The type of the right hand side operand; the seqan3::is_config_element_combineable_v variable template must evaluate to true for both operand types. |
[in] | lhs | The left hand operand. |
[in] | rhs | The right hand operand. |
lhs
and rhs
.The two operands can be either a seqan3::configuration object or a seqan3::detail::config_element. The right hand side operand is then appended to the left hand side operand by creating a new seqan3::configuration object. Neither lhs
nor rhs
will be modified.