27namespace seqan3::detail
30template <
typename search_configuration_t>
31#if !SEQAN3_WORKAROUND_GCC_93467
32 requires is_type_specialisation_of_v<search_configuration_t, configuration>
34struct policy_search_result_builder;
69template <
typename query_id_type,
71 typename reference_id_type,
72 typename reference_begin_position_type>
74 requires (std::integral<query_id_type> || std::same_as<query_id_type, detail::empty_type>) &&
75 (detail::template_specialisation_of<cursor_type, fm_index_cursor> ||
76 detail::template_specialisation_of<cursor_type, bi_fm_index_cursor> ||
77 std::same_as<cursor_type, detail::empty_type>) &&
78 (std::integral<reference_id_type> || std::same_as<reference_id_type, detail::empty_type>) &&
79 (std::integral<reference_begin_position_type> || std::same_as<reference_begin_position_type,
86 query_id_type query_id_{};
88 cursor_type cursor_{};
90 reference_id_type reference_id_{};
92 reference_begin_position_type reference_begin_position_{};
95 template <
typename search_configuration_t>
96 #if !SEQAN3_WORKAROUND_GCC_93467
98 requires detail::is_type_specialisation_of_v<search_configuration_t, configuration>
101 friend struct detail::policy_search_result_builder;
123 static_assert(!std::same_as<query_id_type, detail::empty_type>,
124 "You tried to access the query_id but it was not selected in the output "
125 "configuration of the search.");
134 constexpr auto index_cursor() const noexcept(!(
std::same_as<cursor_type, detail::empty_type>))
136 static_assert(!std::same_as<cursor_type, detail::empty_type>,
137 "You tried to access the index cursor but it was not selected in the output "
138 "configuration of the search.");
149 constexpr auto reference_id() const noexcept(!(
std::same_as<reference_id_type, detail::empty_type>))
151 static_assert(!std::same_as<reference_id_type, detail::empty_type>,
152 "You tried to access the reference id but it was not selected in the output "
153 "configuration of the search.");
155 return reference_id_;
160 noexcept(!(
std::same_as<reference_begin_position_type, detail::empty_type>))
162 static_assert(!std::same_as<reference_begin_position_type, detail::empty_type>,
163 "You tried to access the reference begin position but it was not selected in the "
164 "output configuration of the search.");
166 return reference_begin_position_;
176 bool equality = lhs.query_id_ == rhs.query_id_;
177 if constexpr (!std::is_same_v<cursor_type, detail::empty_type>)
178 equality &= lhs.cursor_ == rhs.cursor_;
179 if constexpr (!std::is_same_v<reference_id_type, detail::empty_type>)
180 equality &= lhs.reference_id_ == rhs.reference_id_;
181 if constexpr (!std::is_same_v<reference_begin_position_type, detail::empty_type>)
182 equality &= lhs.reference_begin_position_ == rhs.reference_begin_position_;
190 return !(lhs == rhs);
202template <
typename char_t,
typename search_result_t>
204 requires detail::is_type_specialisation_of_v<std::remove_cvref_t<search_result_t>, search_result>
206inline debug_stream_type<char_t> &
operator<<(debug_stream_type<char_t> & stream, search_result_t && result)
208 using result_type_list = detail::transfer_template_args_onto_t<std::remove_cvref_t<search_result_t>, type_list>;
211 if constexpr (!std::same_as<list_traits::at<0, result_type_list>, detail::empty_type>)
212 stream <<
"query_id:" << result.query_id();
213 if constexpr (!std::same_as<list_traits::at<1, result_type_list>, detail::empty_type>)
214 stream <<
", index cursor is present";
215 if constexpr (!std::same_as<list_traits::at<2, result_type_list>, detail::empty_type>)
216 stream <<
", reference_id:" << result.reference_id();
217 if constexpr (!std::same_as<list_traits::at<3, result_type_list>, detail::empty_type>)
218 stream <<
", reference_pos:" << result.reference_begin_position();
Provides the seqan3::bi_fm_index_cursor for searching in the bidirectional seqan3::bi_fm_index.
The result class generated by the seqan3::seach algorithm.
Definition: search_result.hpp:83
friend bool operator!=(search_result const &lhs, search_result const &rhs) noexcept
Returns whether lhs and rhs are not the same.
Definition: search_result.hpp:188
search_result()=default
Defaulted.
constexpr auto index_cursor() const noexcept(!(std::same_as< cursor_type, detail::empty_type >))
Returns the index cursor pointing to the suffix array range where the query was found.
Definition: search_result.hpp:134
constexpr auto reference_begin_position() const noexcept(!(std::same_as< reference_begin_position_type, detail::empty_type >))
Returns the reference begin positions where the query was found in the reference text (at reference i...
Definition: search_result.hpp:159
search_result & operator=(search_result &&)=default
Defaulted.
search_result(search_result &&)=default
Defaulted.
friend bool operator==(search_result const &lhs, search_result const &rhs) noexcept
Returns whether lhs and rhs are the same.
Definition: search_result.hpp:174
constexpr auto query_id() const noexcept
Returns the id of the query which produced this search result.
Definition: search_result.hpp:121
search_result & operator=(search_result const &)=default
Defaulted.
search_result(search_result const &)=default
Defaulted.
~search_result()=default
Defaulted.
constexpr auto reference_id() const noexcept(!(std::same_as< reference_id_type, detail::empty_type >))
Returns the reference id where the query was found.
Definition: search_result.hpp:149
The <concepts> header from C++20's standard library.
Provides seqan3::configuration and utility functions.
Provides seqan3::debug_stream and related types.
Provides seqan3::detail::empty_type.
Provides the seqan3::fm_index_cursor for searching in the unidirectional seqan3::fm_index.
debug_stream_type< char_t > & operator<<(debug_stream_type< char_t > &stream, alignment_t &&alignment)
Stream operator for alignments, which are represented as tuples of aligned sequences.
Definition: debug_stream_alignment.hpp:101
The main SeqAn3 namespace.
Definition: cigar_operation_table.hpp:2
SeqAn specific customisations in the standard namespace.
Provides the concept for seqan3::detail::sdsl_index.
Provides type traits for working with templates.