SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
semialphabet_any.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 <
seqan3/alphabet/alphabet_base.hpp
>
13
14
namespace
seqan3
15
{
16
43
template
<
size_t
size>
44
class
semialphabet_any
:
public
alphabet_base
<semialphabet_any<size>, size, void>
45
{
46
private
:
48
using
base_t =
alphabet_base<semialphabet_any<size>
, size,
void
>;
49
51
friend
base_t;
52
53
public
:
54
using
base_t::assign_rank
;
55
using
base_t::to_rank
;
56
60
constexpr
semialphabet_any
() noexcept = default;
61
constexpr
semialphabet_any
(
semialphabet_any
const &) noexcept = default;
62
constexpr
semialphabet_any
(
semialphabet_any
&&) noexcept = default;
63
constexpr
semialphabet_any
& operator=(
semialphabet_any
const &) noexcept = default;
64
constexpr
semialphabet_any
& operator=(
semialphabet_any
&&) noexcept = default;
65
~
semialphabet_any
() noexcept = default;
66
71
template <typename other_alph_t>
72
requires (!
std
::same_as<other_alph_t,
semialphabet_any
>)
73
&&
semialphabet
<other_alph_t> && (
alphabet_size
<other_alph_t> == size)
74
explicit
semialphabet_any
(other_alph_t const other)
75
{
76
assign_rank
(
seqan3::to_rank
(other));
77
}
78
79
84
template
<
typename
other_alph_t>
85
requires
(!std::same_as<other_alph_t, semialphabet_any>)
86
&&
semialphabet<other_alph_t>
&& (
alphabet_size<other_alph_t>
== size) && std::regular<other_alph_t>
87
explicit
operator
other_alph_t()
const
88
{
89
other_alph_t other{};
90
assign_rank_to
(
to_rank
(), other);
91
return
other;
92
}
93
};
94
95
}
// namespace seqan3
alphabet_base.hpp
Provides seqan3::alphabet_base.
seqan3::alphabet_base< semialphabet_any< size >, size, void >::alphabet_base
constexpr alphabet_base() noexcept=default
seqan3::alphabet_base< semialphabet_any< size >, size, void >::to_rank
constexpr rank_type to_rank() const noexcept
Definition
alphabet_base.hpp:134
seqan3::alphabet_base< semialphabet_any< size >, size, void >::alphabet_size
static constexpr detail::min_viable_uint_t< size > alphabet_size
Definition
alphabet_base.hpp:196
seqan3::alphabet_base< semialphabet_any< size >, size, void >::assign_rank
constexpr semialphabet_any< size > & assign_rank(rank_type const c) noexcept
Definition
alphabet_base.hpp:184
seqan3::semialphabet_any::assign_rank
constexpr semialphabet_any< size > & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition
alphabet_base.hpp:184
seqan3::semialphabet_any::to_rank
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition
alphabet_base.hpp:134
seqan3::semialphabet_any::semialphabet_any
constexpr semialphabet_any() noexcept=default
Defaulted.
seqan3::alphabet_size
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition
alphabet/concept.hpp:834
seqan3::assign_rank_to
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition
alphabet/concept.hpp:288
seqan3::to_rank
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition
alphabet/concept.hpp:152
semialphabet
The basis for seqan3::alphabet, but requires only rank interface (not char).
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
Hide me
Version:
seqan3
alphabet
composite
semialphabet_any.hpp
Generated on
for SeqAn3 by
1.17.0