20 namespace seqan3::detail
33 template <
typename alignment_configuration_t>
34 #if !SEQAN3_WORKAROUND_GCC_93467
36 requires is_type_specialisation_of_v<alignment_configuration_t, configuration>
39 class policy_alignment_result_builder
43 using traits_type = alignment_configuration_traits<alignment_configuration_t>;
45 using result_type =
typename traits_type::alignment_result_type;
47 static_assert(!std::same_as<result_type, empty_type>,
"The alignment result type was not configured.");
52 policy_alignment_result_builder() =
default;
53 policy_alignment_result_builder(policy_alignment_result_builder
const &) =
default;
54 policy_alignment_result_builder(policy_alignment_result_builder &&) =
default;
55 policy_alignment_result_builder & operator=(policy_alignment_result_builder
const &) =
default;
56 policy_alignment_result_builder & operator=(policy_alignment_result_builder &&) =
default;
57 ~policy_alignment_result_builder() =
default;
62 policy_alignment_result_builder(alignment_configuration_t
const & SEQAN3_DOXYGEN_ONLY(config))
88 template <
typename sequence_pair_t,
91 typename matrix_coordinate_t,
94 requires std::invocable<callback_t, result_type>
96 void make_result_and_invoke([[maybe_unused]] sequence_pair_t && sequence_pair,
97 [[maybe_unused]] index_t &&
id,
98 [[maybe_unused]] score_t score,
99 [[maybe_unused]] matrix_coordinate_t end_positions,
100 callback_t && callback)
105 result_type result{};
107 if constexpr (traits_type::output_sequence1_id)
108 result.data.sequence1_id =
id;
110 if constexpr (traits_type::output_sequence2_id)
111 result.data.sequence2_id =
id;
113 if constexpr (traits_type::compute_score)
115 static_assert(!std::same_as<decltype(result.data.score), invalid_t>,
116 "Invalid configuration. Expected result with score!");
120 if constexpr (traits_type::compute_end_positions)
122 static_assert(!std::same_as<decltype(result.data.end_positions), invalid_t>,
123 "Invalid configuration. Expected result with end positions!");
125 result.data.end_positions.first = end_positions.col;
126 result.data.end_positions.second = end_positions.row;
Provides seqan3::detail::configuration and utility functions.
Provides seqan3::detail::empty_type.
@ id
The identifier, usually a string.
auto const get
A view calling std::get on each element in a range.
Definition: get.hpp:65
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
Provides seqan3::type_list and auxiliary type traits.
Provides helper type traits for the configuration and execution of the alignment algorithm.