SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
fm_index_cursor.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <tuple>
16 #include <type_traits>
17 
19 
20 namespace seqan3::detail
21 {
22 
32 template <typename index_t>
33 struct fm_index_cursor_node
34 {
36  using size_type = typename index_t::size_type;
40  using sdsl_char_type = typename index_t::sdsl_char_type;
41 
43  size_type lb;
45  size_type rb;
47  size_type depth;
49  sdsl_char_type last_char;
50 
52  bool operator==(fm_index_cursor_node const & rhs) const
53  {
54  // NOTE: last_char is implementation specific for cycle_back().
55  // lb, rb and depth already determine the node in the suffix tree.
56  // Thus there is no need to compare last_char.
57  return std::tie(lb, rb, depth) == std::tie(rhs.lb, rhs.rb, rhs.depth);
58  }
59 
61  bool operator!=(fm_index_cursor_node const & rhs) const
62  {
63  return !(*this == rhs);
64  }
65 
73  template <cereal_archive archive_t>
74  void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
75  {
76  archive(lb);
77  archive(rb);
78  archive(depth);
79  archive(last_char);
80  }
82 };
84 
85 }
Adaptions of concepts from the Cereal library.
T operator!=(T... args)
T tie(T... args)