SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
detail/fm_index_cursor.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <tuple>
13#include <type_traits>
14
16
17namespace seqan3::detail
18{
19
25template <typename index_t>
26struct fm_index_cursor_node
27{
29 using size_type = typename index_t::size_type;
33 using sdsl_char_type = typename index_t::sdsl_char_type;
34
36 size_type lb;
38 size_type rb;
40 size_type depth;
42 sdsl_char_type last_char;
43
45 bool operator==(fm_index_cursor_node const & rhs) const
46 {
47 // NOTE: last_char is implementation specific for cycle_back().
48 // lb, rb and depth already determine the node in the suffix tree.
49 // Thus there is no need to compare last_char.
50 return std::tie(lb, rb, depth) == std::tie(rhs.lb, rhs.rb, rhs.depth);
51 }
52
54 bool operator!=(fm_index_cursor_node const & rhs) const
55 {
56 return !(*this == rhs);
57 }
58
66 template <cereal_archive archive_t>
67 void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
68 {
69 archive(lb);
70 archive(rb);
71 archive(depth);
72 archive(last_char);
73 }
75};
76
77} // namespace seqan3::detail
Adaptions of concepts from the Cereal library.
T operator!=(T... args)
T tie(T... args)
Hide me