SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::policy_search_result_builder< search_configuration_t > Struct Template Reference

Provides the function make_results if inherited by a search algorithm. More...

#include <seqan3/search/detail/policy_search_result_builder.hpp>

Protected Types

using search_result_type = typename search_traits_type::search_result_type
 The configured search result type.
 
using search_traits_type = detail::search_traits< search_configuration_t >
 The traits type over the search configuration.
 

Protected Member Functions

template<typename index_cursor_t , typename query_index_t , typename callback_t >
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.
 
template<typename index_cursor_t , typename query_index_t , typename callback_t >
requires search_traits_type
::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.
 
Constructors, destructor and assignment
 policy_search_result_builder ()=default
 Defaulted.
 
 policy_search_result_builder (policy_search_result_builder &&)=default
 Defaulted.
 
 policy_search_result_builder (policy_search_result_builder const &)=default
 Defaulted.
 
policy_search_result_builderoperator= (policy_search_result_builder &&)=default
 Defaulted.
 
policy_search_result_builderoperator= (policy_search_result_builder const &)=default
 Defaulted.
 
 ~policy_search_result_builder ()=default
 Defaulted.
 
 policy_search_result_builder (search_configuration_t const &)
 Construction from the configuration object.
 

Private Member Functions

template<typename index_cursor_t , typename query_index_t , typename callback_t >
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 config.
 

Detailed Description

template<typename search_configuration_t>
requires seqan3::detail::is_type_specialisation_of_v<search_configuration_t, configuration>
struct seqan3::detail::policy_search_result_builder< search_configuration_t >

Provides the function make_results if inherited by a search algorithm.

Member Function Documentation

◆ make_results() [1/2]

template<typename search_configuration_t >
template<typename index_cursor_t , typename query_index_t , typename callback_t >
void seqan3::detail::policy_search_result_builder< search_configuration_t >::make_results ( std::vector< index_cursor_t >  internal_hits,
query_index_t  idx,
callback_t &&  callback 
)
inlineprotected

Invoke the callback on all hits (index cursors) without calling locate on each cursor.

Template Parameters
index_cursor_tThe type of index cursor used in the search algorithm.
query_index_tThe index type of the query.
callback_tThe callback which is called for every hit.
Parameters
[in]internal_hitsinternal_hits A range over internal cursor results.
[in]idxThe index associated with the current query.
[in]callbackThe callback to invoke for every hit.

The result is independent from the search modus (all, single_best, all_best, strata).

◆ make_results() [2/2]

template<typename search_configuration_t >
template<typename index_cursor_t , typename query_index_t , typename callback_t >
requires search_traits_type
::output_requires_locate_call &&!search_traits_type ::search_single_best_hit void seqan3::detail::policy_search_result_builder< search_configuration_t >::make_results ( std::vector< index_cursor_t >  internal_hits,
query_index_t  idx,
callback_t &&  callback 
)
inlineprotected

Invokes the callback on each seqan3::search_result after calling locate on each cursor.

Template Parameters
index_cursor_tThe type of index cursor used in the search algorithm.
query_index_tThe index type of the query.
callback_tThe callback which is called for every hit.
Parameters
[in]internal_hitsinternal_hits A range over internal cursor results.
[in]idxThe index associated with the current query.
[in]callbackThe callback to invoke for every hit.

This function is used for all search modi except single_best (which are all, all_best, and strata).

The text positions are sorted and made unique by position before invoking the callback on them.

◆ make_results_impl()

template<typename search_configuration_t >
template<typename index_cursor_t , typename query_index_t , typename callback_t >
void seqan3::detail::policy_search_result_builder< search_configuration_t >::make_results_impl ( std::vector< index_cursor_t >  internal_hits,
query_index_t  idx,
callback_t &&  callback 
)
inlineprivate

Invokes the callback on each seqan3::search_result and calls locate on the cursor depending on the config.

Template Parameters
index_cursor_tThe type of index cursor used in the search algorithm.
query_index_tThe index type of the query.
callback_tThe callback which is called for every hit.
Parameters
[in]internal_hitsinternal_hits A range over internal cursor results.
[in]idxThe index associated with the current query.
[in]callbackThe callback to invoke for every hit.

For each cursor in internal_hits, this function calls cursor.layz_locate() if the search configuration requires it (search_traits_type::output_requires_locate_call) and then constructs a seqan3::search_result from the resulting data. The seqan3::search_result will be filled only with the data that was asked for by the user via the search_traits_type::output_[...] trait (e.g. search_traits_type::output_query_id).


The documentation for this struct was generated from the following file:
Hide me