abstract_metric_format.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include <iosfwd>
12 #include "interop/util/cstdint.h"
14 
15 namespace illumina { namespace interop { namespace io
16 {
23  template<class Metric>
25  {
27  typedef Metric metric_t;
29  typedef typename Metric::header_type header_t;
31  typedef typename metric_t::id_t id_t;
32 
36  { }
37 
43  virtual size_t header_size(const header_t &header) const = 0;
44 
50  virtual size_t record_size(const header_t &header) const = 0;
56  virtual size_t buffer_size(const model::metric_base::metric_set<Metric>& metric_set) const=0;
63  virtual void read_metrics(std::istream& in,
65  const size_t file_size)=0;
72  virtual size_t read_header(std::istream& in, model::metric_base::metric_set<Metric>& metric_set)=0;
73 
80  virtual void write_metric(std::ostream &out, const metric_t &metric, const header_t &header) = 0;
81 
87  virtual void write_metric_header(std::ostream &out, const header_t &header) = 0;
88 
93  virtual ::int16_t version() const = 0;
98  virtual bool is_multi_record() const = 0;
103  virtual bool is_deprecated() const = 0;
104  };
105 }}}
106 
107 
Metric metric_t
Definition: abstract_metric_format.h:27
Metric::header_type header_t
Definition: abstract_metric_format.h:29
metric_t::id_t id_t
Definition: abstract_metric_format.h:31
Definition: enum_description.h:15
virtual size_t record_size(const header_t &header) const =0
Definition: abstract_metric_format.h:24
virtual ::int16_t version() const =0
virtual size_t header_size(const header_t &header) const =0
virtual void read_metrics(std::istream &in, model::metric_base::metric_set< Metric > &metric_set, const size_t file_size)=0
virtual void write_metric(std::ostream &out, const metric_t &metric, const header_t &header)=0
virtual ~abstract_metric_format()
Definition: abstract_metric_format.h:35
virtual void write_metric_header(std::ostream &out, const header_t &header)=0
virtual size_t read_header(std::istream &in, model::metric_base::metric_set< Metric > &metric_set)=0
virtual size_t buffer_size(const model::metric_base::metric_set< Metric > &metric_set) const =0
::int64_t file_size(const std::string &path)
Definition: filesystem.cpp:156