empty_plot_test_generator.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include <vector>
13 
14 namespace illumina { namespace interop { namespace unittest
15 {
20  template<class PlotData>
22  {
23  typedef typename abstract_generator<PlotData>::parent_type base_type;
24  public:
30  m_info(model::run::flowcell_layout(1, 2)),
31  m_plot_type(plot_type)
32  {
33  std::string channels[] = {"Red", "Green"};
34  m_info.channels(util::to_vector(channels));
36  const model::run::read_info reads[] = {model::run::read_info(1, 1, 3, false)};
37  m_info.reads(util::to_vector(reads));
38  if(plot_type != constants::UnknownPlotType) m_metric_iterator.reset(m_info, plot_type);
39  }
45  base_type operator()(const constants::plot_types plot_type)const
46  {
47  return new empty_plot_test_generator(plot_type);
48  }
49 
55  ::testing::AssertionResult generate(PlotData&, PlotData &actual, bool*) const
56  {
58  metrics.run_info(m_info);
59  m_metric_iterator.plot(metrics, actual);
60  return ::testing::AssertionSuccess();
61  }
62 
67  base_type clone() const
68  {
69  return new empty_plot_test_generator(*this);
70  }
71 
76  void write(std::ostream &out) const
77  {
78  out << constants::to_string(m_plot_type);
79  out << "Metric_" << constants::to_string(m_metric_iterator.metric()) << "_";
80  out << m_metric_iterator.options();
81  }
86  bool advance()
87  {
88  return m_metric_iterator.advance();
89  }
90 
91  private:
92  metric_filter_iterator m_metric_iterator;
93  model::run::info m_info;
94  constants::plot_types m_plot_type;
95  };
96 
97 
98 }}}
99 
void set_naming_method(const constants::tile_naming_method naming_method)
Definition: info.h:319
base_type operator()(const constants::plot_types plot_type) const
Definition: empty_plot_test_generator.h:45
Definition: enum_description.h:15
::testing::AssertionResult generate(PlotData &, PlotData &actual, bool *) const
Definition: empty_plot_test_generator.h:55
void plot(model::metrics::run_metrics &run, model::plot::plot_data< model::plot::candle_stick_point > &data) const
Definition: metric_filter_iterator.h:72
Definition: metric_filter_iterator.h:24
Definition: generic_fixture.h:23
bool advance()
Definition: empty_plot_test_generator.h:86
plot_types
Definition: enums.h:339
const run::info & run_info() const
Definition: run_metrics.h:256
void reset(const std::string &run_info_filename, const constants::plot_types plot_type)
Definition: metric_filter_iterator.h:57
const read_vector_t & reads() const
Definition: info.h:235
constants::metric_type metric() const
Definition: metric_filter_iterator.h:197
bool advance()
Definition: metric_filter_iterator.h:217
const model::plot::filter_options & options() const
Definition: metric_filter_iterator.h:208
void write(std::ostream &out) const
Definition: empty_plot_test_generator.h:76
empty_plot_test_generator(const constants::plot_types plot_type=constants::UnknownPlotType)
Definition: empty_plot_test_generator.h:29
base_type clone() const
Definition: empty_plot_test_generator.h:67
Definition: empty_plot_test_generator.h:21
std::string to_string(Enum value)
Definition: enums.h:43
const str_vector_t & channels() const
Definition: info.h:221