SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
alphabet/aminoacid/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
10
11
#pragma once
12
13
#include <
type_traits
>
14
15
#include <
seqan3/alphabet/concept.hpp
>
16
#include <
seqan3/core/detail/template_inspection.hpp
>
17
18
// ============================================================================
19
// aminoacid_empty_base
20
// ============================================================================
21
22
namespace
seqan3
23
{
24
31
struct
aminoacid_empty_base
32
{};
33
34
}
// namespace seqan3
35
36
// ============================================================================
37
// enable_aminoacid
38
// ============================================================================
39
40
namespace
seqan3::detail::adl_only
41
{
42
44
template
<
typename
... args_t>
45
void
enable_aminoacid
(args_t...) =
delete
;
46
49
template
<
typename
alphabet_t>
50
struct
enable_aminoacid_cpo :
public
detail::customisation_point_object<enable_aminoacid_cpo<alphabet_t>, 2>
51
{
53
using
base_t = detail::customisation_point_object<enable_aminoacid_cpo<alphabet_t>, 2>;
55
using
base_t::base_t;
56
60
template
<
typename
alphabet_type>
61
using
alphabet_or_type_identity =
62
std::conditional_t<std::is_nothrow_default_constructible_v<std::remove_cvref_t<alphabet_type>
>
63
&& seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alphabet_type>>,
64
std::remove_cvref_t<alphabet_type>,
65
std::type_identity<alphabet_type>>;
66
70
template
<
typename
alphabet_type = alphabet_t>
71
static
constexpr
auto
SEQAN3_CPO_OVERLOAD
(priority_tag<2>)(
72
/*return*/
std::bool_constant<seqan3::custom::alphabet<alphabet_type>::enable_aminoacid
>::value ==
true
/*;*/
73
);
74
84
template
<
typename
alphabet_type = alphabet_t>
85
static
constexpr
auto
SEQAN3_CPO_OVERLOAD
(priority_tag<1>)(
86
/*return*/
std::bool_constant
<
enable_aminoacid
(alphabet_or_type_identity<alphabet_type>{})>::value ==
true
/*;*/
87
);
88
92
template
<
typename
alphabet_type = alphabet_t>
93
static
constexpr
auto
SEQAN3_CPO_OVERLOAD
(priority_tag<0>)(
94
/*return*/
std::is_base_of_v<seqan3::aminoacid_empty_base, alphabet_type>
==
true
/*;*/
95
);
96
};
97
98
}
// namespace seqan3::detail::adl_only
99
100
namespace
seqan3
101
{
102
148
template
<
typename
t>
149
inline
constexpr
bool
enable_aminoacid
=
150
detail::adl_only::enable_aminoacid_cpo<std::remove_cvref_t<t>>::cpo_overload(detail::priority_tag<2>{});
151
152
// ============================================================================
153
// concept
154
// ============================================================================
155
172
template
<
typename
type>
173
concept
aminoacid_alphabet
=
alphabet<type>
&&
enable_aminoacid<type>
;
175
176
}
// namespace seqan3
concept.hpp
Core alphabet concept and free function/type trait wrappers.
std::conditional_t
SEQAN3_CPO_OVERLOAD
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition
customisation_point.hpp:106
seqan3::enable_aminoacid
constexpr bool enable_aminoacid
A trait that indicates whether a type shall model seqan3::aminoacid_alphabet.
Definition
alphabet/aminoacid/concept.hpp:143
std::bool_constant
alphabet
The generic alphabet concept that covers most data types used in ranges.
aminoacid_alphabet
A concept that indicates whether an alphabet represents amino acids.
std::is_base_of_v
T is_base_of_v
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
seqan3::aminoacid_empty_base
This is an empty base class that can be inherited by types that shall model seqan3::aminoacid_alphabe...
Definition
alphabet/aminoacid/concept.hpp:32
template_inspection.hpp
Provides type traits for working with templates.
type_traits
Hide me
Version:
seqan3
alphabet
aminoacid
concept.hpp
Generated on
for SeqAn3 by
1.17.0