metric_format< Metric, Layout > Struct Template Reference

#include <metric_format.h>

Inheritance diagram for metric_format< Metric, Layout >:
abstract_metric_format< Metric >

Public Types

typedef Metric metric_t
 
typedef Metric::header_type header_t
 
typedef Layout::metric_id_t metric_id_t
 
typedef Layout::record_size_t record_size_t
 
- Public Types inherited from abstract_metric_format< Metric >
typedef Metric metric_t
 
typedef Metric::header_type header_t
 
typedef metric_t::id_t id_t
 

Public Member Functions

void write_metric_header (std::ostream &out, const header_t &header)
 
void write_metric (std::ostream &out, const metric_t &metric, const header_t &header)
 
size_t read_header (std::istream &in, model::metric_base::metric_set< Metric > &metric_set)
 
void read_metrics (std::istream &in, metric_set_t &metric_set, const size_t file_size)
 
std::streamsize read_header_impl (std::istream &in, header_t &header)
 
size_t buffer_size (const model::metric_base::metric_set< Metric > &metric_set) const
 
size_t record_size (const header_t &header) const
 
size_t header_size (const header_t &header) const
 
::int16_t version () const
 
bool is_multi_record () const
 
bool is_deprecated () const
 
- Public Member Functions inherited from abstract_metric_format< Metric >
virtual ~abstract_metric_format ()
 

Detailed Description

template<class Metric, class Layout>
struct illumina::interop::io::metric_format< Metric, Layout >

Shared functionality for reading and writing binary InterOp metrics

This format assumes that the binary file as the following format:

  1. First byte is the version number
  2. Second byte is the record size
  3. Optional header
  4. A series of records (as defined by Layout)

Member Typedef Documentation

typedef Metric::header_type header_t

Define the metric header type

typedef Layout::metric_id_t metric_id_t

Define a layout ID type

typedef Metric metric_t

Define the metric type

typedef Layout::record_size_t record_size_t

Define the record size type

Member Function Documentation

size_t buffer_size ( const model::metric_base::metric_set< Metric > &  metric_set) const
inlinevirtual

Calculate the size of a record

Parameters
metric_setsource set of metrics
Returns
size of buffer in bytes

Implements abstract_metric_format< Metric >.

size_t header_size ( const header_t header) const
inlinevirtual

Calculate the size of a record

Parameters
headermetric set header
Returns
size of header in bytes

Implements abstract_metric_format< Metric >.

bool is_deprecated ( ) const
inlinevirtual

Is the format no longer supported

Returns
true if this format is no longer supported

Implements abstract_metric_format< Metric >.

bool is_multi_record ( ) const
inlinevirtual

Is the format a multi-record format

Returns
true if multiple records make up a single metric

Implements abstract_metric_format< Metric >.

size_t read_header ( std::istream &  in,
model::metric_base::metric_set< Metric > &  metric_set 
)
inlinevirtual

Read the header into a metric set

Parameters
ininput stream
metric_setdestination set of metrics
Returns
number of bytes read

Implements abstract_metric_format< Metric >.

std::streamsize read_header_impl ( std::istream &  in,
header_t header 
)
inline

Read a metric set from the given input stream

Parameters
ininput stream containing binary InterOp file data
headermetric set header
Returns
number of bytes in the record
void read_metrics ( std::istream &  in,
metric_set_t metric_set,
const size_t  file_size 
)
inlinevirtual

Read all the metrics into a metric set

Parameters
ininput stream
metric_setdestination set of metrics
file_sizesize of the file

Implements abstract_metric_format< Metric >.

size_t record_size ( const header_t header) const
inlinevirtual

Calculate the size of a record

Parameters
headermetric set header
Returns
size of record in bytes

Implements abstract_metric_format< Metric >.

::int16_t version ( ) const
inlinevirtual

Get the version of this metric format

Returns
version number

Implements abstract_metric_format< Metric >.

void write_metric ( std::ostream &  out,
const metric_t metric,
const header_t header 
)
inlinevirtual

Write a metric record to the given output stream

Parameters
outoutput stream
metrica metric to write
headermetric set header

Implements abstract_metric_format< Metric >.

void write_metric_header ( std::ostream &  out,
const header_t header 
)
inlinevirtual

Write the header of a metric InterOp to the given output stream

Parameters
outoutput stream to write the binary InterOp file data
headerheader of a metric set

Implements abstract_metric_format< Metric >.


The documentation for this struct was generated from the following file: