base_read_metric.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <algorithm>
15 
16 namespace illumina { namespace interop { namespace model { namespace metric_base
17 {
18  class base_read_metric;
19 
22  {
23  public:
26 
27  public:
30 
31  public:
37  {
38  return base_read_metric_header();
39  }
40 
41  protected:
46  void clear(){}
54  };
55 
61  {
62  public:
69  typedef uint8_t read_t;
70  public:
78  base_metric(lane, tile), m_read(static_cast<read_t>(read)) { }
79 
80  public:
87  void set_base(const uint_t lane, const uint_t tile)
88  {
89  base_metric::set_base(lane, tile);
90  }
98  void set_base(const uint_t lane, const uint_t tile, const uint_t read)
99  {
100  base_metric::set_base(lane, tile);
101  m_read = static_cast<read_t>(read);
102  }
107  template<class BaseReadMetric>
108  void set_base(const BaseReadMetric &base)
109  {
110  base_metric::set_base(base);
111  m_read = static_cast<read_t>(base.read);
112  }
113 
118  uint_t read() const { return m_read; }
119 
124  id_t id() const
125  {
126  return create_id(lane(), tile(), m_read);
127  }
128 
136  static id_t create_id(const id_t lane, const id_t tile, const id_t read)
137  {
138  return base_metric::create_id(lane, tile) | (read << READ_BIT_SHIFT);
139  }
145  static id_t read_from_id(const id_t id)
146  {
147  // 1. Shift off lane and tile bits
148  // 2. Shift back, while shifting off reserved bits
150  }
156  bool operator< (const base_read_metric& metric2) const
157  {
158  return id() < metric2.id();
159  }
160 
161  private:
162  read_t m_read;
163  };
164 
166  template<>
167  struct metric_attributes<base_read_metric> : public metric_attributes<base_metric>{};
168 
169 
170 }}}}
171 
172 
::uint32_t id_t
Definition: base_metric.h:74
static id_t create_id(const id_t lane, const id_t tile, const id_t read)
Definition: base_read_metric.h:136
Definition: enum_description.h:15
base_read_metric_header header_type
Definition: base_read_metric.h:65
uint_t tile() const
Definition: base_metric.h:284
id_t id() const
Definition: base_read_metric.h:124
void update_max_cycle(const base_read_metric &)
Definition: base_read_metric.h:53
constants::base_read_t base_t
Definition: base_read_metric.h:25
void set_base(const uint_t lane, const uint_t tile)
Definition: base_metric.h:188
static id_t create_id(const id_t lane, const id_t tile, const id_t=0)
Definition: base_metric.h:229
Definition: type_traits.h:131
::uint32_t uint_t
Definition: base_metric.h:77
uint_t lane() const
Definition: base_metric.h:269
constants::base_read_t base_t
Definition: base_read_metric.h:67
void set_base(const uint_t lane, const uint_t tile, const uint_t read)
Definition: base_read_metric.h:98
bool operator<(const base_read_metric &metric2) const
Definition: base_read_metric.h:156
uint8_t read_t
Definition: base_read_metric.h:69
base_read_metric_header()
Definition: base_read_metric.h:29
void set_base(const uint_t lane, const uint_t tile)
Definition: base_read_metric.h:87
static base_read_metric_header default_header()
Definition: base_read_metric.h:36
static id_t read_from_id(const id_t id)
Definition: base_read_metric.h:145
void set_base(const BaseReadMetric &base)
Definition: base_read_metric.h:108
uint_t read() const
Definition: base_read_metric.h:118
base_read_metric(const uint_t lane, const uint_t tile, const uint_t read)
Definition: base_read_metric.h:77