SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
A semi-alphabet that type erases all other semi-alphabets of the same size. More...
#include <seqan3/alphabet/composite/semialphabet_any.hpp>
Public Member Functions | |
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> | |
operator other_alph_t () const | |
Enable conversion of semialphabet_any into other (semi-)alphabet of the same size. | |
Constructors, destructor and assignment | |
constexpr | semialphabet_any () noexcept=default |
Defaulted. | |
constexpr | semialphabet_any (semialphabet_any const &) noexcept=default |
Defaulted. | |
constexpr | semialphabet_any (semialphabet_any &&) noexcept=default |
Defaulted. | |
constexpr semialphabet_any & | operator= (semialphabet_any const &) noexcept=default |
Defaulted. | |
constexpr semialphabet_any & | operator= (semialphabet_any &&) noexcept=default |
Defaulted. | |
~semialphabet_any () noexcept=default | |
Defaulted. | |
template<typename other_alph_t > requires (!std::same_as<other_alph_t, semialphabet_any>) && semialphabet<other_alph_t> && (alphabet_size<other_alph_t> == size) | |
semialphabet_any (other_alph_t const other) | |
Construct semialphabet_any from alphabet of the same size. | |
Public Member Functions inherited from seqan3::alphabet_base< semialphabet_any< size >, size, void > | |
constexpr | alphabet_base () noexcept=default |
Defaulted. | |
constexpr | alphabet_base (alphabet_base const &) noexcept=default |
Defaulted. | |
constexpr | alphabet_base (alphabet_base &&) noexcept=default |
Defaulted. | |
constexpr alphabet_base & | operator= (alphabet_base const &) noexcept=default |
Defaulted. | |
constexpr alphabet_base & | operator= (alphabet_base &&) noexcept=default |
Defaulted. | |
~alphabet_base () noexcept=default | |
Defaulted. | |
constexpr char_type | to_char () const noexcept |
Return the letter as a character of char_type. | |
constexpr rank_type | to_rank () const noexcept |
Return the letter's numeric value (rank in the alphabet). | |
constexpr semialphabet_any< size > & | assign_char (char_type const chr) noexcept |
Assign from a character, implicitly converts invalid characters. | |
constexpr semialphabet_any< size > & | assign_rank (rank_type const c) noexcept |
Assign from a numeric value. | |
Additional Inherited Members | |
Static Public Attributes inherited from seqan3::alphabet_base< semialphabet_any< size >, size, void > | |
static constexpr detail::min_viable_uint_t< size > | alphabet_size |
The size of the alphabet, i.e. the number of different values it can take. | |
Protected Types inherited from seqan3::alphabet_base< semialphabet_any< size >, size, void > | |
using | char_type = std::conditional_t< std::same_as< void, void >, char, void > |
The char representation; conditional needed to make semi alphabet definitions legal. | |
using | rank_type = detail::min_viable_uint_t< size - 1 > |
The type of the alphabet when represented as a number (e.g. via to_rank()). | |
A semi-alphabet that type erases all other semi-alphabets of the same size.
This alphabet provides a generic representation for different alphabets of the same size by erasing the type of the alphabet it is constructed from. This enables the usage of a single type although assigning different alphabets. The semialphabet_any can also be converted to any other (semi-)alphabet of the same size. It is therefore possible to convert the semialphabet_any into an alphabet type that is not the original alphabet type. However, this should either be avoided or used with care as no warnings are given when attempting to convert the semialphabet_any into a type that is not comparable to the original alphabet type. The main advantage of using this data structure is to reduce instantiation of templates when using multiple alphabets of the same size and either their character representation is not important or they are reified at a later point in the program.
|
inlineexplicit |
Construct semialphabet_any from alphabet of the same size.
|
inlineexplicit |
Enable conversion of semialphabet_any into other (semi-)alphabet of the same size.