25 namespace seqan3::detail
28 template <
typename search_configuration_t>
29 #if !SEQAN3_WORKAROUND_GCC_93467
30 requires is_type_specialisation_of_v<search_configuration_t, configuration>
31 #endif // !SEQAN3_WORKAROUND_GCC_93467
32 struct policy_search_result_builder;
65 template <
typename query_id_type,
67 typename reference_id_type,
68 typename reference_begin_position_type>
70 requires (std::integral<query_id_type> || std::same_as<query_id_type, detail::empty_type>) &&
72 (std::integral<reference_id_type> || std::same_as<reference_id_type, detail::empty_type>) &&
73 (std::integral<reference_begin_position_type> || std::same_as<reference_begin_position_type,
80 query_id_type query_id_{};
82 cursor_type cursor_{};
84 reference_id_type reference_id_{};
86 reference_begin_position_type reference_begin_position_{};
89 template <
typename search_configuration_t>
90 #if !SEQAN3_WORKAROUND_GCC_93467
91 requires detail::is_type_specialisation_of_v<search_configuration_t, configuration>
94 #endif // !SEQAN3_WORKAROUND_GCC_93467
95 friend struct detail::policy_search_result_builder;
113 constexpr
auto query_id() const noexcept
116 static_assert(!std::same_as<query_id_type, detail::empty_type>,
117 "You tried to access the query_id but it was not selected in the output "
118 "configuration of the search.");
127 constexpr
auto index_cursor() const noexcept(!(
std::same_as<cursor_type, detail::empty_type>))
129 static_assert(!std::same_as<cursor_type, detail::empty_type>,
130 "You tried to access the index cursor but it was not selected in the output "
131 "configuration of the search.");
142 constexpr
auto reference_id() const noexcept(!(
std::same_as<reference_id_type, detail::empty_type>))
144 static_assert(!std::same_as<reference_id_type, detail::empty_type>,
145 "You tried to access the reference id but it was not selected in the output "
146 "configuration of the search.");
148 return reference_id_;
153 noexcept(!(
std::same_as<reference_begin_position_type, detail::empty_type>))
155 static_assert(!std::same_as<reference_begin_position_type, detail::empty_type>,
156 "You tried to access the reference begin position but it was not selected in the "
157 "output configuration of the search.");
159 return reference_begin_position_;
169 bool equality = lhs.query_id_ == rhs.query_id_;
170 if constexpr (!std::is_same_v<cursor_type, detail::empty_type>)
171 equality &= lhs.cursor_ == rhs.cursor_;
172 if constexpr (!std::is_same_v<reference_id_type, detail::empty_type>)
173 equality &= lhs.reference_id_ == rhs.reference_id_;
174 if constexpr (!std::is_same_v<reference_begin_position_type, detail::empty_type>)
175 equality &= lhs.reference_begin_position_ == rhs.reference_begin_position_;
183 return !(lhs == rhs);
195 template <
typename char_t,
typename search_result_t>
197 requires detail::is_type_specialisation_of_v<std::remove_cvref_t<search_result_t>, search_result>
199 inline debug_stream_type<char_t> &
operator<<(debug_stream_type<char_t> & stream, search_result_t && result)
201 using result_type_list = detail::transfer_template_args_onto_t<std::remove_cvref_t<search_result_t>,
type_list>;
204 if constexpr (!std::same_as<list_traits::at<0, result_type_list>, detail::empty_type>)
205 stream << "query_id:" << result.query_id();
206 if constexpr (!
std::same_as<list_traits::
at<1, result_type_list>, detail::empty_type>)
207 stream << ", index cursor is present";
208 if constexpr (!
std::same_as<list_traits::
at<2, result_type_list>, detail::empty_type>)
209 stream << ", reference_id:" << result.reference_id();
210 if constexpr (!
std::same_as<list_traits::
at<3, result_type_list>, detail::empty_type>)
211 stream << ", reference_pos:" << result.reference_begin_position();