Loading...
Searching...
No Matches
search_traits.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <seqan3/core/detail/empty_type.hpp>
#include <seqan3/search/configuration/hit.hpp>
#include <seqan3/search/configuration/max_error.hpp>
#include <seqan3/search/configuration/on_result.hpp>
#include <seqan3/search/configuration/output.hpp>
#include <seqan3/search/configuration/result_type.hpp>
#include <seqan3/utility/type_traits/basic.hpp>
namespace seqan3::detail
{
template <typename search_configuration_t>
struct search_traits
{
using empty_search_result_type = search_result<empty_type, empty_type, empty_type, empty_type>;
using search_result_type = typename std::remove_cvref_t<decltype(std::declval<search_configuration_t>().get_or(
search_cfg::detail::result_type<empty_search_result_type>{}))>::type;
static constexpr bool has_max_error_total = search_configuration_t::template exists<search_cfg::max_error_total>();
static constexpr bool has_max_error_substitution =
search_configuration_t::template exists<search_cfg::max_error_substitution>();
static constexpr bool has_max_error_insertion =
search_configuration_t::template exists<search_cfg::max_error_insertion>();
static constexpr bool has_max_error_deletion =
search_configuration_t::template exists<search_cfg::max_error_deletion>();
static constexpr bool only_max_error_total =
has_max_error_total && !has_max_error_substitution && !has_max_error_insertion && !has_max_error_deletion;
static constexpr bool search_all_hits = search_configuration_t::template exists<search_cfg::hit_all>();
static constexpr bool search_single_best_hit =
search_configuration_t::template exists<search_cfg::hit_single_best>();
static constexpr bool search_all_best_hits = search_configuration_t::template exists<search_cfg::hit_all_best>();
static constexpr bool search_strata_hits = search_configuration_t::template exists<search_cfg::hit_strata>();
static constexpr bool has_hit_configuration = search_all_hits || search_single_best_hit || search_all_best_hits
|| search_strata_hits
|| search_configuration_t::template exists<search_cfg::hit>();
static constexpr bool output_query_id = search_configuration_t::template exists<search_cfg::output_query_id>();
static constexpr bool output_reference_id =
search_configuration_t::template exists<search_cfg::output_reference_id>();
static constexpr bool output_reference_begin_position =
search_configuration_t::template exists<search_cfg::output_reference_begin_position>();
static constexpr bool output_index_cursor =
search_configuration_t::template exists<search_cfg::output_index_cursor>();
static constexpr bool output_requires_locate_call = output_reference_id | output_reference_begin_position;
static constexpr bool has_output_configuration =
output_query_id | output_reference_id | output_reference_begin_position | output_index_cursor;
static constexpr bool has_user_callback = search_configuration_t::template exists<search_cfg::on_result>();
};
} // namespace seqan3::detail
basic.hpp
Provides various type traits on generic types.
empty_type.hpp
Provides seqan3::detail::empty_type.
hit.hpp
Provides the configuration to define the hit strategies "hit_strata", "hit_all", "hit_all_best",...
max_error.hpp
Provides the configuration for maximum number of errors for all error types.
on_result.hpp
Provides seqan3::search_cfg::on_result.
result_type.hpp
Provides seqan3::search_cfg::detail::result_type.
output.hpp
Provides the configuration for the content of the search result.
Hide me