default_layout.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include <ios>
13 
14 namespace illumina { namespace interop { namespace io
15 {
18  template<int V, int MultiRecord=0,int Deprecated=0>
20  {
21  enum
22  {
24  VERSION = V,
26  MULTI_RECORD=MultiRecord,
28  IS_DEPRECATED=Deprecated
29  };
31  typedef ::uint8_t record_size_t;
33  typedef ::uint8_t version_t;
34 
41  template<class Stream, class Header>
42  static std::streamsize map_stream_for_header(Stream &, Header &)
43  {
44  return 0;
45  }
46 
53  template<class Stream, class RecordSize>
54  static RecordSize map_stream_record_size(Stream &stream, RecordSize record_size)
55  {
56  stream_map<RecordSize>(stream, record_size);
57  return record_size;
58  }
66  template<class Metric>
67  static bool skip_metric(const Metric& metric)
68  {
69  return metric.id() == 0;
70  }
78  template<class LayoutId>
79  static bool is_valid(const LayoutId& id)
80  {
81  return id.is_valid();
82  }
83  };
84 }}}
85 
86 
Definition: enum_description.h:15
static RecordSize map_stream_record_size(Stream &stream, RecordSize record_size)
Definition: default_layout.h:54
::uint8_t version_t
Definition: default_layout.h:33
static bool skip_metric(const Metric &metric)
Definition: default_layout.h:67
static bool is_valid(const LayoutId &id)
Definition: default_layout.h:79
Definition: default_layout.h:24
size_t record_size(const typename MetricType::header_type &header, const ::int16_t version=MetricType::LATEST_VERSION)
Definition: metric_stream.h:134
::uint8_t record_size_t
Definition: default_layout.h:31
static std::streamsize map_stream_for_header(Stream &, Header &)
Definition: default_layout.h:42
Definition: default_layout.h:19