From 756c028b9aacf985e79e94461d0144054fe40cc4 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 2 Apr 2025 15:01:59 +0200 Subject: [PATCH] [MISC] Separate Bloom Filter strong types Such that including the bloom_filter does not trigger deprecation warnings --- .../dream_index/interleaved_bloom_filter.hpp | 38 +------------ .../utility/bloom_filter/bloom_filter.hpp | 6 +- .../bloom_filter_strong_types.hpp | 56 +++++++++++++++++++ 3 files changed, 63 insertions(+), 37 deletions(-) create mode 100644 include/seqan3/utility/bloom_filter/bloom_filter_strong_types.hpp diff --git a/include/seqan3/search/dream_index/interleaved_bloom_filter.hpp b/include/seqan3/search/dream_index/interleaved_bloom_filter.hpp index b024bbb413..16437da94d 100644 --- a/include/seqan3/search/dream_index/interleaved_bloom_filter.hpp +++ b/include/seqan3/search/dream_index/interleaved_bloom_filter.hpp @@ -14,47 +14,13 @@ #include #include -#include +//Todo: When removing, the contents of the following header can be moved into utility/bloom_filter/bloom_filter.hpp +#include SEQAN3_DEPRECATED_HEADER("This header and its functionality is deprecated and will be removed in a future version of SeqAn. Please use the hibf-library (url: https://github.com/seqan/hibf) instead."); namespace seqan3 { -//!\brief Determines if the Interleaved Bloom Filter is compressed. -//!\ingroup search_dream_index -enum data_layout : bool -{ - uncompressed, //!< The Interleaved Bloom Filter is uncompressed. - compressed //!< The Interleaved Bloom Filter is compressed. -}; - -//!\brief A strong type that represents the number of bins for the seqan3::interleaved_bloom_filter. -//!\ingroup search_dream_index -struct bin_count : public detail::strong_type -{ - using detail::strong_type::strong_type; -}; - -//!\brief A strong type that represents the number of bits for each bin in the seqan3::interleaved_bloom_filter. -//!\ingroup search_dream_index -struct bin_size : public detail::strong_type -{ - using detail::strong_type::strong_type; -}; - -//!\brief A strong type that represents the number of hash functions for the seqan3::interleaved_bloom_filter. -//!\ingroup search_dream_index -struct hash_function_count : public detail::strong_type -{ - using detail::strong_type::strong_type; -}; - -//!\brief A strong type that represents the bin index for the seqan3::interleaved_bloom_filter. -//!\ingroup search_dream_index -struct bin_index : public detail::strong_type -{ - using detail::strong_type::strong_type; -}; /*!\brief The IBF binning directory. A data structure that efficiently answers set-membership queries for multiple bins. * \ingroup search_dream_index diff --git a/include/seqan3/utility/bloom_filter/bloom_filter.hpp b/include/seqan3/utility/bloom_filter/bloom_filter.hpp index 4c095c3922..988accd1d8 100644 --- a/include/seqan3/utility/bloom_filter/bloom_filter.hpp +++ b/include/seqan3/utility/bloom_filter/bloom_filter.hpp @@ -9,7 +9,11 @@ #pragma once -#include +#include +#include +//Todo: When removing search/dream_index/interleaved_bloom_filter.hpp, the contents of the following header can be +// moved into this file +#include namespace seqan3 { diff --git a/include/seqan3/utility/bloom_filter/bloom_filter_strong_types.hpp b/include/seqan3/utility/bloom_filter/bloom_filter_strong_types.hpp new file mode 100644 index 0000000000..d77d153eb4 --- /dev/null +++ b/include/seqan3/utility/bloom_filter/bloom_filter_strong_types.hpp @@ -0,0 +1,56 @@ +// 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 + +/*!\file + * \author Enrico Seiler + * \brief Provides strong types for the (Interleaved) Bloom Filter. + */ + +#pragma once + +#include + +//Todo: When removing search/dream_index/interleaved_bloom_filter.hpp, the contents of this header can be moved +// into utility/bloom_filter/bloom_filter.hpp + +namespace seqan3 +{ + +//!\brief Determines if the Interleaved Bloom Filter is compressed. +//!\ingroup utility_bloom_filter +enum data_layout : bool +{ + uncompressed, //!< The Interleaved Bloom Filter is uncompressed. + compressed //!< The Interleaved Bloom Filter is compressed. +}; + +//!\brief A strong type that represents the number of bins for the seqan3::interleaved_bloom_filter. +//!\ingroup utility_bloom_filter +struct bin_count : public detail::strong_type +{ + using detail::strong_type::strong_type; +}; + +//!\brief A strong type that represents the number of bits for each bin in the seqan3::interleaved_bloom_filter. +//!\ingroup utility_bloom_filter +struct bin_size : public detail::strong_type +{ + using detail::strong_type::strong_type; +}; + +//!\brief A strong type that represents the number of hash functions for the seqan3::interleaved_bloom_filter. +//!\ingroup utility_bloom_filter +struct hash_function_count : public detail::strong_type +{ + using detail::strong_type::strong_type; +}; + +//!\brief A strong type that represents the bin index for the seqan3::interleaved_bloom_filter. +//!\ingroup utility_bloom_filter +struct bin_index : public detail::strong_type +{ + using detail::strong_type::strong_type; +}; + +} // namespace seqan3