vdj_pipe
pipeline for processing DNA sequence data
step_variant_store.hpp
Go to the documentation of this file.
1 
7 #ifndef STEP_VARIANT_STORE_HPP_
8 #define STEP_VARIANT_STORE_HPP_
9 #include <vector>
10 #include "boost/foreach.hpp"
11 #include "vdj_pipe/config.hpp"
16 
17 namespace vdj_pipe{
18 
19 namespace step{
20 
23 typedef boost::mpl::insert_range<
25  boost::mpl::end<universal_steps>::type,
26  boost::mpl::insert_range<
28  boost::mpl::end<single_read_only_vector>::type,
29  boost::mpl::push_back<paired_read_only_vector,External_mid_infile>::type
30  >::type
31 >::type all_steps_vector;
32 
33 }//namespace step
34 
35 typedef boost::make_recursive_variant_over<step::all_steps_vector>::type
36  step_variant_all;
37 
40 class VDJ_PIPE_DECL Step_variant_store {
41 public:
42 
43  void push_back(step_variant_all const& sva) {svv_.push_back(sva);}
44 
45  template<class Visitor> void visit(Visitor const& visitor) {
46  BOOST_FOREACH(step_variant_all& sv, svv_) {
47  boost::apply_visitor(visitor, sv);
48  }
49  }
50 
51  template<class Visitor> void visit(Visitor& visitor) {
52  BOOST_FOREACH(step_variant_all& sv, svv_) {
53  boost::apply_visitor(visitor, sv);
54  }
55  }
56 
57  //used for testing
58  step_variant_all const& step(const std::size_t n) const {return svv_[n];}
59  step_variant_all& step(const std::size_t n) {return svv_[n];}
60 
61 private:
62  std::vector<step_variant_all> svv_;
63 };
64 
65 }//namespace vdj_pipe
66 #endif /* STEP_VARIANT_STORE_HPP_ */
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
boost::mpl::vector< Ambiguous_window_filter, Average_quality_filter, Average_quality_window_filter, Character_filter, Composition_stats, External_mid_inline, Find_shared, Homopolymer_filter, Length_filter, Match_step, Min_quality_filter, Min_quality_window_filter, Qual_stats, Write_seq > single_read_only_vector
List of steps suitable for single read pipes ONLY.
Definition: step_variant_single_read.hpp:53
boost::mpl::vector< Blank_step, Histogram_step, Write_value > universal_steps
List of steps that can be used in all pipes.
Definition: step_variant_universal.hpp:24
Definition: step_variant_store.hpp:40