Loading...
Searching...
No Matches
core/configuration/detail/concept.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <array>
#include <concepts>
#include <functional>
#include <type_traits>
#include <seqan3/core/detail/template_inspection.hpp>
namespace seqan3
{
// Forward declarations
struct pipeable_config_element;
} // namespace seqan3
namespace seqan3::detail
{
// ----------------------------------------------------------------------------
// compatibility_table
// ----------------------------------------------------------------------------
template <typename algorithm_id_type>
inline constexpr std::array<std::array<void *, 0>, 0> compatibility_table{};
// ----------------------------------------------------------------------------
// Concept config_element
// ----------------------------------------------------------------------------
template <typename config_t>
concept config_element = requires {
requires std::is_base_of_v<seqan3::pipeable_config_element, config_t>;
requires std::movable<config_t>;
{ config_t::id };
};
template <typename config1_t, typename config2_t>
concept config_element_pipeable_with =
config_element<config1_t> && config_element<config2_t>
&& std::same_as<std::remove_cvref_t<decltype(config1_t::id)>, std::remove_cvref_t<decltype(config2_t::id)>>
&& compatibility_table<std::remove_cvref_t<decltype(config1_t::id)>>[static_cast<int32_t>(config1_t::id)]
[static_cast<int32_t>(config2_t::id)];
} // namespace seqan3::detail
namespace seqan3
{
// Forward declaration.
template <detail::config_element... configs_t>
class configuration;
template <typename config1_t, typename config2_t>
inline constexpr bool is_config_element_combineable_v = detail::config_element_pipeable_with<config1_t, config2_t>;
// Specialised for config2_t == seqan3::configuration
template <typename config1_t, typename... configs2_t>
inline constexpr bool is_config_element_combineable_v<config1_t, configuration<configs2_t...>> =
(detail::config_element_pipeable_with<config1_t, configs2_t> && ...);
// Specialised for config1_t == seqan3::configuration
template <typename... configs1_t, typename config2_t>
inline constexpr bool is_config_element_combineable_v<configuration<configs1_t...>, config2_t> =
(detail::config_element_pipeable_with<configs1_t, config2_t> && ...);
// Specialised for config1_t == seqan3::configuration && config2_t == seqan3::configuration
template <typename... configs1_t, typename... configs2_t>
inline constexpr bool is_config_element_combineable_v<configuration<configs1_t...>, configuration<configs2_t...>> =
(is_config_element_combineable_v<configs1_t, configuration<configs2_t...>> && ...);
} // namespace seqan3
array
seqan3::configuration
Collection of elements to configure an algorithm.
Definition configuration.hpp:42
functional
seqan3::is_config_element_combineable_v
constexpr bool is_config_element_combineable_v
Helper variable template to test if a configuration element is combineable with another configuration...
Definition core/configuration/detail/concept.hpp:127
std::is_base_of_v
T is_base_of_v
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
seqan3::pipeable_config_element
Adds pipe interface to configuration elements.
Definition pipeable_config_element.hpp:29
template_inspection.hpp
Provides type traits for working with templates.
type_traits
Hide me