71namespace seqan3::detail::adl_only
75template <
typename... args_t>
76void to_rank(args_t...) =
delete;
80struct to_rank_cpo :
public detail::customisation_point_object<to_rank_cpo, 2>
83 using base_t = detail::customisation_point_object<to_rank_cpo, 2>;
91 template <
typename alphabet_t>
100 template <
typename alphabet_t>
109 template <
typename alphabet_t>
111 std::forward<alphabet_t>(
alphabet).to_rank()
161inline constexpr auto to_rank = detail::adl_only::to_rank_cpo{};
169template <
typename semi_alphabet_type>
183namespace seqan3::detail::adl_only
187template <
typename... args_t>
192struct assign_rank_to_cpo :
public detail::customisation_point_object<assign_rank_to_cpo, 2>
195 using base_t = detail::customisation_point_object<assign_rank_to_cpo, 2>;
197 using base_t::base_t;
212 template <
typename alphabet_t>
213 static constexpr auto
231 template <
typename alphabet_t>
232 static constexpr auto
247 template <
typename alphabet_t>
248 static constexpr auto
250 static_cast<alphabet_t
>(std::forward<alphabet_t>(
alphabet).assign_rank(rank))
305inline constexpr auto assign_rank_to = detail::adl_only::assign_rank_to_cpo{};
313namespace seqan3::detail::adl_only
317template <
typename... args_t>
318void to_char(args_t...) =
delete;
322struct to_char_cpo :
public detail::customisation_point_object<to_char_cpo, 2>
325 using base_t = detail::customisation_point_object<to_char_cpo, 2>;
327 using base_t::base_t;
333 template <
typename alphabet_t>
342 template <
typename alphabet_t>
351 template <
typename alphabet_t>
353 std::forward<alphabet_t>(
alphabet).to_char()
404inline constexpr auto to_char = detail::adl_only::to_char_cpo{};
412template <
typename alphabet_type>
413 requires requires (alphabet_type
const a) {
426namespace seqan3::detail::adl_only
430template <
typename... args_t>
435struct assign_char_to_cpo :
public detail::customisation_point_object<assign_char_to_cpo, 2>
438 using base_t = detail::customisation_point_object<assign_char_to_cpo, 2>;
440 using base_t::base_t;
455 template <
typename alphabet_t>
456 static constexpr auto
474 template <
typename alphabet_t>
475 static constexpr auto
490 template <
typename alphabet_t>
491 static constexpr auto
493 static_cast<alphabet_t
>(
alphabet.assign_char(chr))
548inline constexpr auto assign_char_to = detail::adl_only::assign_char_to_cpo{};
556namespace seqan3::detail::adl_only
560template <
typename... args_t>
567template <
typename alphabet_t>
568struct char_is_valid_for_cpo :
public detail::customisation_point_object<char_is_valid_for_cpo<alphabet_t>, 3>
571 using base_t = detail::customisation_point_object<char_is_valid_for_cpo<alphabet_t>, 3>;
573 using base_t::base_t;
578 template <
typename alphabet_type>
579 using alphabet_or_type_identity =
588 template <
typename alphabet_type = alphabet_t>
589 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<3>, alphabet_char_t<alphabet_type>
const chr)(
603 template <
typename alphabet_type = alphabet_t>
604 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<2>, alphabet_char_t<alphabet_type>
const chr)(
612 template <
typename alphabet_type = alphabet_t>
613 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<1>, alphabet_char_t<alphabet_type>
const chr)(
637 template <
typename alphabet_type = alphabet_t>
638 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<0>, alphabet_char_t<alphabet_type>
const chr)(
696template <
typename alph_t>
699 to_char(std::declval<alph_t>())
702inline constexpr auto char_is_valid_for = detail::adl_only::char_is_valid_for_cpo<alph_t>{};
710namespace seqan3::detail::adl_only
715struct assign_char_strictly_to_fn
718 template <
typename alphabet_t>
720 requires requires () {
723 } -> std::convertible_to<alphabet_t>;
725 seqan3::char_is_valid_for<alphabet_t>(chr)
726 } -> std::same_as<bool>;
729 if (!seqan3::char_is_valid_for<alphabet_t>(chr))
774namespace seqan3::detail::adl_only
778template <
typename... args_t>
785template <
typename alphabet_t>
786struct alphabet_size_cpo :
public detail::customisation_point_object<alphabet_size_cpo<alphabet_t>, 2>
789 using base_t = detail::customisation_point_object<alphabet_size_cpo<alphabet_t>, 2>;
791 using base_t::base_t;
796 template <
typename alphabet_type>
797 using alphabet_or_type_identity =
799 && seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alphabet_type>>,
806 template <
typename alphabet_type = alphabet_t>
819 template <
typename alphabet_type = alphabet_t>
827 template <
typename alphabet_type = alphabet_t>
881template <
typename alph_t>
884 detail::adl_only::alphabet_size_cpo<alph_t>{}()
887inline constexpr auto alphabet_size = detail::adl_only::alphabet_size_cpo<alph_t>{}();
936concept semialphabet = std::totally_ordered<t> && std::copy_constructible<t> && std::is_nothrow_copy_constructible_v<t>
939 seqan3::alphabet_size<t>
1026template <
typename t>
1075template <
typename t>
1108template <cereal_output_archive archive_t, semialphabet alphabet_t>
1109alphabet_rank_t<alphabet_t> CEREAL_SAVE_MINIMAL_FUNCTION_NAME(archive_t
const &, alphabet_t
const & l)
1127template <cereal_input_archive archive_t,
typename wrapped_alphabet_t>
1128void CEREAL_LOAD_MINIMAL_FUNCTION_NAME(archive_t
const &,
1129 wrapped_alphabet_t && l,
1130 alphabet_rank_t<detail::strip_cereal_wrapper_t<wrapped_alphabet_t>>
const & r)
1133 assign_rank_to(r,
static_cast<detail::strip_cereal_wrapper_t<wrapped_alphabet_t> &
>(l));
1141namespace seqan3::detail
1156template <
typename t>
1157concept constexpr_semialphabet =
1178template <
typename t>
1179concept writable_constexpr_semialphabet =
1201template <
typename t>
1202concept constexpr_alphabet =
1203 constexpr_semialphabet<t> &&
alphabet<t> &&
requires {
1224template <
typename t>
1225concept writable_constexpr_alphabet =
Exceptions thrown by entities in the alphabet module.
Provides various type traits on generic types.
Adaptions of concepts from the Cereal library.
Helper utilities for defining customisation point objects (CPOs).
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition customisation_point.hpp:107
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition alphabet/concept.hpp:524
constexpr auto to_char
Return the char representation of an alphabet object.
Definition alphabet/concept.hpp:386
decltype(seqan3::to_rank(std::declval< semi_alphabet_type >())) alphabet_rank_t
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition alphabet/concept.hpp:169
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition alphabet/concept.hpp:849
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition alphabet/concept.hpp:293
decltype(seqan3::to_char(std::declval< alphabet_type const >())) alphabet_char_t
The char_type of the alphabet; defined as the return type of seqan3::to_char.
Definition alphabet/concept.hpp:400
constexpr auto char_is_valid_for
Returns whether a character is in the valid set of a seqan3::alphabet (usually implies a bijective ma...
Definition alphabet/concept.hpp:670
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition alphabet/concept.hpp:734
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition alphabet/concept.hpp:155
The generic alphabet concept that covers most data types used in ranges.
The basis for seqan3::alphabet, but requires only rank interface (not char).
Refines seqan3::alphabet and adds assignability.
A refinement of seqan3::semialphabet that adds assignability.
A namespace for third party and standard library specialisations of SeqAn customisation points.
Definition char.hpp:42
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:29
A type that can be specialised to provide customisation point implementations so that third party typ...
Definition alphabet/concept.hpp:49
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition alphabet/exception.hpp:30
Provides traits to inspect some information of a type, for example its name.
Provides concepts that do not have equivalents in C++20.