SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
core/configuration/detail/concept.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
array
>
13
#include <concepts>
14
#include <
functional
>
15
#include <
type_traits
>
16
17
#include <
seqan3/core/detail/template_inspection.hpp
>
18
19
namespace
seqan3
20
{
22
// Forward declarations
23
struct
pipeable_config_element
;
25
}
// namespace seqan3
26
27
namespace
seqan3::detail
28
{
29
30
// ----------------------------------------------------------------------------
31
// compatibility_table
32
// ----------------------------------------------------------------------------
33
39
template
<
typename
algorithm_
id
_type>
40
inline
constexpr
std::array<std::array<void *, 0>, 0> compatibility_table{};
41
42
// ----------------------------------------------------------------------------
43
// Concept config_element
44
// ----------------------------------------------------------------------------
45
53
64
template
<
typename
config_t>
65
concept
config_element =
requires
{
66
requires
std::is_base_of_v<seqan3::pipeable_config_element, config_t>
;
67
requires
std::movable<config_t>;
68
{ config_t::id };
69
};
71
88
template
<
typename
config1_t,
typename
config2_t>
89
concept
config_element_pipeable_with =
90
config_element<config1_t> && config_element<config2_t>
91
&& std::same_as<std::remove_cvref_t<
decltype
(config1_t::id)>, std::remove_cvref_t<
decltype
(config2_t::id)>>
92
&& compatibility_table<std::remove_cvref_t<
decltype
(config1_t::id)>>[
static_cast<
int32_t
>
(config1_t::id)]
93
[
static_cast<
int32_t
>
(config2_t::id)];
95
96
}
// namespace seqan3::detail
97
98
namespace
seqan3
99
{
101
// Forward declaration.
102
template
<detail::config_element... configs_t>
103
class
configuration
;
105
126
template
<
typename
config1_t,
typename
config2_t>
127
inline
constexpr
bool
is_config_element_combineable_v
= detail::config_element_pipeable_with<config1_t, config2_t>;
128
130
// Specialised for config2_t == seqan3::configuration
131
template
<
typename
config1_t,
typename
... configs2_t>
132
inline
constexpr
bool
is_config_element_combineable_v
<config1_t,
configuration
<configs2_t...>> =
133
(detail::config_element_pipeable_with<config1_t, configs2_t> && ...);
134
135
// Specialised for config1_t == seqan3::configuration
136
template
<
typename
... configs1_t,
typename
config2_t>
137
inline
constexpr
bool
is_config_element_combineable_v
<
configuration
<configs1_t...>, config2_t> =
138
(detail::config_element_pipeable_with<configs1_t, config2_t> && ...);
139
140
// Specialised for config1_t == seqan3::configuration && config2_t == seqan3::configuration
141
template
<
typename
... configs1_t,
typename
... configs2_t>
142
inline
constexpr
bool
is_config_element_combineable_v
<
configuration
<configs1_t...>,
configuration
<configs2_t...>> =
143
(
is_config_element_combineable_v
<configs1_t,
configuration
<configs2_t...>> && ...);
145
146
}
// 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
Version:
seqan3
core
configuration
detail
concept.hpp
Generated on
for SeqAn3 by
1.17.0