SeqAn3  3.1.0-rc.1
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 
28 template <typename index_t>
29 struct fm_index_cursor_node
30 {
32  using size_type = typename index_t::size_type;
36  using sdsl_char_type = typename index_t::sdsl_char_type;
37 
39  size_type lb;
41  size_type rb;
43  size_type depth;
45  sdsl_char_type last_char;
46 
48  bool operator==(fm_index_cursor_node const & rhs) const
49  {
50  // NOTE: last_char is implementation specific for cycle_back().
51  // lb, rb and depth already determine the node in the suffix tree.
52  // Thus there is no need to compare last_char.
53  return std::tie(lb, rb, depth) == std::tie(rhs.lb, rhs.rb, rhs.depth);
54  }
55 
57  bool operator!=(fm_index_cursor_node const & rhs) const
58  {
59  return !(*this == rhs);
60  }
61 
69  template <cereal_archive archive_t>
70  void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
71  {
72  archive(lb);
73  archive(rb);
74  archive(depth);
75  archive(last_char);
76  }
78 };
79 
80 }
Adaptions of concepts from the Cereal library.
T operator!=(T... args)
T tie(T... args)