Loading...
Searching...
No Matches
semialphabet_any.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 <seqan3/alphabet/alphabet_base.hpp>
namespace seqan3
{
template <size_t size>
class semialphabet_any : public alphabet_base<semialphabet_any<size>, size, void>
{
private:
using base_t = alphabet_base<semialphabet_any<size>, size, void>;
friend base_t;
public:
using base_t::assign_rank;
using base_t::to_rank;
constexpr semialphabet_any() noexcept = default;
constexpr semialphabet_any(semialphabet_any const &) noexcept = default;
constexpr semialphabet_any(semialphabet_any &&) noexcept = default;
constexpr semialphabet_any & operator=(semialphabet_any const &) noexcept = default;
constexpr semialphabet_any & operator=(semialphabet_any &&) noexcept = default;
~semialphabet_any() noexcept = default;
template <typename other_alph_t>
requires (!std::same_as<other_alph_t, semialphabet_any>)
&& semialphabet<other_alph_t> && (alphabet_size<other_alph_t> == size)
explicit semialphabet_any(other_alph_t const other)
{
assign_rank(seqan3::to_rank(other));
}
template <typename other_alph_t>
requires (!std::same_as<other_alph_t, semialphabet_any>)
&& semialphabet<other_alph_t> && (alphabet_size<other_alph_t> == size) && std::regular<other_alph_t>
explicit operator other_alph_t() const
{
other_alph_t other{};
assign_rank_to(to_rank(), other);
return other;
}
};
} // 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