22template <
typename search_configuration_t>
23 requires seqan3::detail::is_type_specialisation_of_v<search_configuration_t, configuration>
32 static_assert(!std::same_as<search_result_type, typename search_traits_type::empty_search_result_type>,
33 "The search result type was not configured properly.");
64 template <
typename index_cursor_t,
typename query_index_t,
typename callback_t>
67 return make_results_impl(std::move(internal_hits), idx, std::forward<callback_t>(callback));
86 template <
typename index_cursor_t,
typename query_index_t,
typename callback_t>
103 [](
auto const & r1,
auto const & r2)
105 return (r1.reference_id() == r2.reference_id())
106 ? (r1.reference_begin_position() < r2.reference_begin_position())
107 : (r1.reference_id() < r2.reference_id());
110 results.erase(
std::unique(results.begin(), results.end()), results.end());
134 template <
typename index_cursor_t,
typename query_index_t,
typename callback_t>
136 [[maybe_unused]] query_index_t idx,
137 callback_t && callback)
139 auto maybe_locate = [](
auto const & cursor)
142 return cursor.lazy_locate();
147 for (
auto const & cursor : internal_hits)
149 for (
auto && [
ref_id, ref_pos] : maybe_locate(cursor))
154 result.query_id_ = std::move(idx);
156 result.cursor_ = cursor;
158 result.reference_id_ = std::move(
ref_id);
160 result.reference_begin_position_ = std::move(ref_pos);
The result class generated by the seqan3::seach algorithm.
Definition search_result.hpp:76
@ ref_id
The identifier of the (reference) sequence that seqan3::field::seq was aligned to.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides the concept for seqan3::detail::sdsl_index.
Provides seqan3::search_result.
Provides seqan3::detail::search_traits.
Provides the function make_results if inherited by a search algorithm.
Definition policy_search_result_builder.hpp:25
policy_search_result_builder(policy_search_result_builder const &)=default
Defaulted.
void make_results(std::vector< index_cursor_t > internal_hits, query_index_t idx, callback_t &&callback)
Invoke the callback on all hits (index cursors) without calling locate on each cursor.
Definition policy_search_result_builder.hpp:65
policy_search_result_builder(search_configuration_t const &)
Construction from the configuration object.
Definition policy_search_result_builder.hpp:46
~policy_search_result_builder()=default
Defaulted.
policy_search_result_builder & operator=(policy_search_result_builder &&)=default
Defaulted.
policy_search_result_builder()=default
Defaulted.
void make_results_impl(std::vector< index_cursor_t > internal_hits, query_index_t idx, callback_t &&callback)
Invokes the callback on each seqan3::search_result and calls locate on the cursor depending on the co...
Definition policy_search_result_builder.hpp:135
policy_search_result_builder(policy_search_result_builder &&)=default
Defaulted.
::output_requires_locate_call &&!search_traits_type ::search_single_best_hit void make_results(std::vector< index_cursor_t > internal_hits, query_index_t idx, callback_t &&callback)
Invokes the callback on each seqan3::search_result after calling locate on each cursor.
Definition policy_search_result_builder.hpp:88
policy_search_result_builder & operator=(policy_search_result_builder const &)=default
Defaulted.
typename search_traits_type::search_result_type search_result_type
The configured search result type.
Definition policy_search_result_builder.hpp:30
A collection of traits extracted from the search configuration.
Definition search_traits.hpp:31
static constexpr bool output_requires_locate_call
A flag indicating whether it is required to call cursor.locate() to retrieve the respective informati...
Definition search_traits.hpp:80
typename std::remove_cvref_t< decltype(std::declval< search_configuration_t >().get_or(search_cfg::detail::result_type< empty_search_result_type >{}))>::type search_result_type
The configured search result type.
Definition search_traits.hpp:36
static constexpr bool output_query_id
A flag indicating whether search should return the query_id.
Definition search_traits.hpp:69
static constexpr bool search_single_best_hit
A flag indicating whether search should find best hits.
Definition search_traits.hpp:57
static constexpr bool output_index_cursor
A flag indicating whether search should return the index_cursor.
Definition search_traits.hpp:77
static constexpr bool output_reference_id
A flag indicating whether search should return the reference_id.
Definition search_traits.hpp:71
static constexpr bool output_reference_begin_position
A flag indicating whether search should return the reference_begin_position.
Definition search_traits.hpp:74
Provides type traits for working with templates.