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-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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>
34 {
36  using size_type = typename index_t::size_type;
40  using sdsl_char_type = typename index_t::sdsl_char_type;
41 
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.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
#define CEREAL_SERIALIZE_FUNCTION_NAME
Macro for Cereal's serialize function.
Definition: platform.hpp:134
Internal representation of the node of an FM index cursor.
Definition: fm_index_cursor.hpp:34
size_type rb
Right suffix array bound.
Definition: fm_index_cursor.hpp:45
bool operator==(fm_index_cursor_node const &rhs) const
Comparison of two cursor nodes.
Definition: fm_index_cursor.hpp:52
sdsl_char_type last_char
Label of the last edge moved down. Needed for cycle_back().
Definition: fm_index_cursor.hpp:49
bool operator!=(fm_index_cursor_node const &rhs) const
Comparison of two cursor nodes.
Definition: fm_index_cursor.hpp:61
typename index_t::size_type size_type
Type for representing positions in the indexed text.
Definition: fm_index_cursor.hpp:36
typename index_t::sdsl_char_type sdsl_char_type
The type of the reduced alphabet type. (The reduced alphabet might be smaller than the original alpha...
Definition: fm_index_cursor.hpp:40
size_type depth
Depth of the node in the suffix tree, i.e. length of the searched query.
Definition: fm_index_cursor.hpp:47
size_type lb
Left suffix array bound.
Definition: fm_index_cursor.hpp:43
T tie(T... args)