15 #include <type_traits>
71 namespace seqan3::detail::adl_only
75 template <
typename... args_t>
76 void to_rank(args_t...) =
delete;
80 struct 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()
161 inline constexpr
auto to_rank = detail::adl_only::to_rank_cpo{};
169 template <
typename semi_alphabet_type>
175 using alphabet_rank_t = decltype(
seqan3::to_rank(std::declval<semi_alphabet_type>()));
183 namespace seqan3::detail::adl_only
187 template <
typename... args_t>
192 struct 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))
305 inline constexpr
auto assign_rank_to = detail::adl_only::assign_rank_to_cpo{};
313 namespace seqan3::detail::adl_only
317 template <
typename... args_t>
318 void to_char(args_t...) =
delete;
322 struct 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()
404 inline constexpr
auto to_char = detail::adl_only::to_char_cpo{};
412 template <
typename alphabet_type>
418 using alphabet_char_t = decltype(
seqan3::to_char(std::declval<alphabet_type const>()));
426 namespace seqan3::detail::adl_only
430 template <
typename... args_t>
435 struct 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))
548 inline constexpr
auto assign_char_to = detail::adl_only::assign_char_to_cpo{};
556 namespace seqan3::detail::adl_only
560 template <
typename... args_t>
567 template <
typename alphabet_t>
568 struct 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 =
581 std::remove_cvref_t<alphabet_type>,
582 std::type_identity<alphabet_type>>;
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)(
614 std::remove_cvref_t<alphabet_type>::char_is_valid(chr) ==
true
637 template <
typename alphabet_type = alphabet_t>
638 static constexpr
auto SEQAN3_CPO_OVERLOAD(priority_tag<0>, alphabet_char_t<alphabet_type>
const chr)(
696 template <
typename alph_t>
699 to_char(std::declval<alph_t>())
702 inline constexpr
auto char_is_valid_for = detail::adl_only::char_is_valid_for_cpo<alph_t>{};
710 namespace seqan3::detail::adl_only
715 struct assign_char_strictly_to_fn
718 template <
typename alphabet_t>
719 constexpr decltype(
auto) operator()(
seqan3::alphabet_char_t<alphabet_t> const chr, alphabet_t &&
alphabet) const
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))
774 namespace seqan3::detail::adl_only
778 template <
typename... args_t>
779 void alphabet_size(args_t...) =
delete;
785 template <
typename alphabet_t>
786 struct 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>>,
800 std::remove_cvref_t<alphabet_type>,
801 std::type_identity<alphabet_type>>;
806 template <
typename alphabet_type = alphabet_t>
819 template <
typename alphabet_type = alphabet_t>
821 alphabet_size(alphabet_or_type_identity<alphabet_type>{})
827 template <
typename alphabet_type = alphabet_t>
829 std::remove_cvref_t<alphabet_type>::alphabet_size
881 template <
typename alph_t>
884 detail::adl_only::alphabet_size_cpo<alph_t>{}()
887 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_cpo<alph_t>{}();
935 template <
typename t>
936 concept
semialphabet = std::totally_ordered<t> && std::copy_constructible<t> && std::is_nothrow_copy_constructible_v<t>
939 seqan3::alphabet_size<t>
986 template <
typename t>
1026 template <
typename t>
1075 template <
typename t>
1108 template <cereal_output_archive archive_t, semialphabet alphabet_t>
1109 alphabet_rank_t<alphabet_t> CEREAL_SAVE_MINIMAL_FUNCTION_NAME(archive_t
const &, alphabet_t
const & l)
1127 template <cereal_input_archive archive_t,
typename wrapped_alphabet_t>
1128 void 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));
1141 namespace seqan3::detail
1156 template <
typename t>
1157 concept constexpr_semialphabet =
1178 template <
typename t>
1179 concept writable_constexpr_semialphabet =
1201 template <
typename t>
1202 concept constexpr_alphabet =
1224 template <
typename t>
1225 concept 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 char_is_valid_for
Return the rank representation of a (semi-)alphabet object.
Definition: alphabet/concept.hpp:670
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: alphabet/concept.hpp:386
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: alphabet/concept.hpp:293
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
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.