27 namespace seqan3::detail
30 template <
typename search_configuration_t>
31 requires is_type_specialisation_of_v<search_configuration_t, configuration>
32 struct policy_search_result_builder;
67 template <
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;
99 search_result() =
default;
100 search_result(search_result
const &) =
default;
101 search_result(search_result &&) =
default;
102 search_result & operator=(search_result
const &) =
default;
103 search_result & operator=(search_result &&) =
default;
104 ~search_result() =
default;
113 constexpr
auto query_id() const noexcept
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_;
151 constexpr
auto reference_begin_position() const
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_;
166 friend bool operator==(search_result
const & lhs, search_result
const & rhs) noexcept
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_;
180 friend bool operator!=(search_result
const & lhs, search_result
const & rhs) noexcept
182 return !(lhs == rhs);
194 template <
typename char_t,
typename search_result_t>
195 requires detail::is_type_specialisation_of_v<std::remove_cvref_t<search_result_t>, search_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.
A "pretty printer" for most SeqAn data structures and related types.
Definition: debug_stream_type.hpp:78
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.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
requires detail::debug_stream_range_guard< alignment_matrix_t > &&detail::matrix< alignment_matrix_t > debug_stream_type< char_t > & operator<<(debug_stream_type< char_t > &s, alignment_matrix_t &&matrix)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: debug_matrix.hpp:496
SeqAn specific customisations in the standard namespace.
Provides the concept for seqan3::detail::sdsl_index.
Type that contains multiple types.
Definition: type_list.hpp:29
Provides type traits for working with templates.