Collection of elements to configure an algorithm.
More...
#include <seqan3/core/configuration/configuration.hpp>
|
template<typename this_t , typename query_t , typename alternative_t > |
static constexpr decltype(auto) | get_or_impl (this_t &&me, query_t const &query, alternative_t &&alternative) noexcept |
| Internal implementation of the get_or interace. More...
|
|
template<typename this_t , template< typename ... > typename query_template_t, typename ... parameters_t, typename alternative_t > |
static constexpr decltype(auto) | get_or_impl (this_t &&me, query_template_t< parameters_t... > const &, 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<detail::config_element ... _configs_t> |
class | configuration |
| Friend declaration for other instances of the configuration.
|
|
|
(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...
|
|
|
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.
|
|
|
template<template< typename ... > class query_t, typename ... configs_t> |
constexpr auto & | get (configuration< configs_t... > &config) noexcept |
| Returns the stored element. More...
|
|
|
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.
|
|
|
Note that modifications return new configurations and do not modify this .
|
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.
|
|
template<int index> |
constexpr auto | remove_at () const |
| Remove a config element from the configuration. More...
|
|
template<detail::config_element ... configs_t>
class seqan3::configuration< configs_t >
Collection of elements to configure an algorithm.
- Template Parameters
-
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.
◆ configuration()
template<detail::config_element ... configs_t>
template<typename config_element_t >
Constructs a configuration from a single configuration element.
- Template Parameters
-
- Parameters
-
[in] | config_element | The configuration element to construct the configuration from. |
◆ append()
template<detail::config_element ... configs_t>
template<typename other_configuration_t >
Returns a new configuration by appending the given configuration to the current one.
- Template Parameters
-
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. |
- Parameters
-
[in] | other_config | The other configuration to append to the current one. |
- Returns
- A new configuration containing the appended configuration elements.
This function generates a new configuration object containing the appended configuration elements. The current configuration will not be modified.
◆ get_or()
template<detail::config_element ... configs_t>
template<typename alternative_t >
Returns the stored configuration element if present otherwise the given alternative.
- Template Parameters
-
alternative_t | The type of the configuration element that is queried. |
- Parameters
-
[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.
- Returns
- The stored configuration element identified by
alternative_t
or the alternative if not present.
Example
enum struct my_id : int
{
bar_id,
foo_id
};
struct bar : public seqan3::pipeable_config_element<bar>
{
public:
float value{};
bar() = default;
bar(bar const &) = default;
bar(bar &&) = default;
~bar() = default;
bar(float v) : value{v}
{}
static constexpr my_id id{my_id::bar_id};
};
template <typename t>
class foo : public seqan3::pipeable_config_element<foo<t>>
{
public:
t value{};
foo() = default;
foo(foo const &) = default;
foo(foo &&) = default;
~foo() = default;
{}
static constexpr my_id id{my_id::foo_id};
};
template <typename t>
foo(t) -> foo<t>;
int main()
{
}
Collection of elements to configure an algorithm.
Definition: configuration.hpp:46
constexpr configuration & operator=(configuration const &)=default
Defaulted.
Provides seqan3::configuration and utility functions.
Provides seqan3::debug_stream and related types.
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:42
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:70
SeqAn specific customisations in the standard namespace.
Provides seqan3::pipeable_config_element.
Exception
no-throw guarantee.
Complexity
Constant time.
◆ get_or_impl()
template<detail::config_element ... configs_t>
template<typename this_t , typename query_t , typename alternative_t >
static constexpr decltype(auto) seqan3::configuration< configs_t >::get_or_impl |
( |
this_t && |
me, |
|
|
query_t const & |
query, |
|
|
alternative_t && |
alternative |
|
) |
| |
|
inlinestaticconstexprprivatenoexcept |
Internal implementation of the get_or interace.
- Template Parameters
-
this_t | The type of this. |
query_t | The type of the configuration element to query. |
alternative_t | The type of the alternative. |
- Parameters
-
[in] | me | The perfectly forwarded instance of *this . |
[in] | query | The queried configuration element [only the type is needed]. |
[in] | alternative | The alternative configuration element to return if the query_t is not present. |
Use the type query_t
to check if such a configuration element is stored in me
. If this is true
then the stored configuration element is returned using perfect forwarding. If this evaluates to false
the given alternative is returned. If query_t
is a class template then it is checked if any specialisation of this class template is stored.
◆ remove()
template<detail::config_element ... configs_t>
template<typename query_t >
Remove a config element from the configuration.
- Template Parameters
-
query_t | The config element type to remove from the configuration. |
- Returns
- A new configuration object without the config element identified by
query_t
.
◆ remove_at()
template<detail::config_element ... configs_t>
template<int index>
Remove a config element from the configuration.
- Template Parameters
-
index | The config element at index is removed from the config. |
- Returns
- A new configuration object without the config element at
index
.
◆ operator|()
template<typename lhs_config_t , typename rhs_config_t >
constexpr auto operator| |
( |
lhs_config_t && |
lhs, |
|
|
rhs_config_t && |
rhs |
|
) |
| |
|
related |
The documentation for this class was generated from the following file: