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 
20 class VDJ_PIPE_DECL Depth_iter {
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_ */
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
Definition: depth_first_iterator.hpp:20
Generalized DNA suffix tree.
Definition: gdst.hpp:66