vdj_pipe
pipeline for processing DNA sequence data
depth_first_iterator.hpp
Go to the documentation of this file.
1 
7 #ifndef DEPTH_FIRST_ITERATOR_HPP_
8 #define DEPTH_FIRST_ITERATOR_HPP_
9 #include <stack>
10 #include <utility>
11 #include "boost/assert.hpp"
12 #include "vdj_pipe/config.hpp"
14 
15 namespace vdj_pipe{ namespace gdst{
16 class Gdst;
17 
21  typedef std::pair<Branch_id, unsigned> branch_t;
22  typedef std::stack<branch_t> stack;
23 public:
24  Depth_iter(Gdst const& t, const Branch_id bid) : t_(t) {
25  BOOST_ASSERT(bid);
26  s_.push(branch_t(bid, 0));
27  }
28 
29  void next();
30 
31  Branch_id id() const {
32  BOOST_ASSERT( ! at_end() );
33  return s_.top().first;
34  }
35 
36  bool at_end() const {return s_.empty();}
37 
38 private:
39  Gdst const& t_;
40  stack s_;
41 };
42 
43 }//namespace gdst
44 }//namespace vdj_pipe
45 #endif /* DEPTH_FIRST_ITERATOR_HPP_ */
bool at_end() const
Definition: depth_first_iterator.hpp:36
std::pair< Branch_id, unsigned > branch_t
Definition: depth_first_iterator.hpp:21
Depth_iter(Gdst const &t, const Branch_id bid)
Definition: depth_first_iterator.hpp:24
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
#define VDJ_PIPE_DECL
Definition: config.hpp:23
Definition: depth_first_iterator.hpp:20
std::stack< branch_t > stack
Definition: depth_first_iterator.hpp:22
stack s_
Definition: depth_first_iterator.hpp:40
Generalized DNA suffix tree.
Definition: gdst.hpp:66
Branch_id id() const
Definition: depth_first_iterator.hpp:31
Gdst const & t_
Definition: depth_first_iterator.hpp:39