27namespace seqan3::detail
30template <
typename search_configuration_t>
31 requires is_type_specialisation_of_v<search_configuration_t, configuration>
32struct policy_search_result_builder;
67template <
typename query_id_type,
69 typename reference_id_type,
70 typename reference_begin_position_type>
71 requires (std::integral<query_id_type> || std::same_as<query_id_type, detail::empty_type>)
72 && (detail::template_specialisation_of<cursor_type, fm_index_cursor>
73 || detail::template_specialisation_of<cursor_type, bi_fm_index_cursor>
74 || std::same_as<cursor_type, detail::empty_type>)
75 && (std::integral<reference_id_type> || std::same_as<reference_id_type, detail::empty_type>)
76 && (std::integral<reference_begin_position_type>
77 || std::same_as<reference_begin_position_type, detail::empty_type>)
82 query_id_type query_id_{};
84 cursor_type cursor_{};
86 reference_id_type reference_id_{};
88 reference_begin_position_type reference_begin_position_{};
91 template <
typename search_configuration_t>
92 requires detail::is_type_specialisation_of_v<search_configuration_t, configuration>
93 friend struct detail::policy_search_result_builder;
115 static_assert(!std::same_as<query_id_type, detail::empty_type>,
116 "You tried to access the query_id but it was not selected in the output "
117 "configuration of the search.");
126 constexpr auto index_cursor() const noexcept(!(
std::same_as<cursor_type, detail::empty_type>))
128 static_assert(!std::same_as<cursor_type, detail::empty_type>,
129 "You tried to access the index cursor but it was not selected in the output "
130 "configuration of the search.");
141 constexpr auto reference_id() const noexcept(!(
std::same_as<reference_id_type, detail::empty_type>))
143 static_assert(!std::same_as<reference_id_type, detail::empty_type>,
144 "You tried to access the reference id but it was not selected in the output "
145 "configuration of the search.");
147 return reference_id_;
152 noexcept(!(
std::same_as<reference_begin_position_type, detail::empty_type>))
154 static_assert(!std::same_as<reference_begin_position_type, detail::empty_type>,
155 "You tried to access the reference begin position but it was not selected in the "
156 "output configuration of the search.");
158 return reference_begin_position_;
168 bool equality = lhs.query_id_ == rhs.query_id_;
169 if constexpr (!std::is_same_v<cursor_type, detail::empty_type>)
170 equality &= lhs.cursor_ == rhs.cursor_;
171 if constexpr (!std::is_same_v<reference_id_type, detail::empty_type>)
172 equality &= lhs.reference_id_ == rhs.reference_id_;
173 if constexpr (!std::is_same_v<reference_begin_position_type, detail::empty_type>)
174 equality &= lhs.reference_begin_position_ == rhs.reference_begin_position_;
182 return !(lhs == rhs);
194template <
typename char_t,
typename search_result_t>
195 requires detail::is_type_specialisation_of_v<std::remove_cvref_t<search_result_t>, search_result>
196inline debug_stream_type<char_t> &
operator<<(debug_stream_type<char_t> & stream, search_result_t && result)
198 using result_type_list = detail::transfer_template_args_onto_t<std::remove_cvref_t<search_result_t>, type_list>;
201 if constexpr (!std::same_as<list_traits::at<0, result_type_list>, detail::empty_type>)
202 stream <<
"query_id:" << result.query_id();
203 if constexpr (!std::same_as<list_traits::at<1, result_type_list>, detail::empty_type>)
204 stream <<
", index cursor is present";
205 if constexpr (!std::same_as<list_traits::at<2, result_type_list>, detail::empty_type>)
206 stream <<
", reference_id:" << result.reference_id();
207 if constexpr (!std::same_as<list_traits::at<3, result_type_list>, detail::empty_type>)
208 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:79
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:180
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:126
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:151
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:166
constexpr auto query_id() const noexcept
Returns the id of the query which produced this search result.
Definition: search_result.hpp:113
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:141
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:110
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
Provides the concept for seqan3::detail::sdsl_index.
Provides type traits for working with templates.