#include <metric_set.h>

Inheritance diagram for metric_set< T >:

Public Types

enum  { TYPE =metric_attributes<T>::TYPE, LATEST_VERSION =metric_attributes<T>::LATEST_VERSION }
 
typedef std::vector< T > metric_array_t
 
typedef T::header_type header_type
 
typedef T::base_t base_t
 
typedef T metric_type
 
typedef metric_set< T > metric_set_type
 
typedef T::id_t id_t
 
typedef T::uint_t uint_t
 
typedef std::vector< uint_tid_vector
 
typedef std::vector< id_tkey_vector
 
typedef metric_array_t::size_type size_type
 
typedef std::set< uint_tid_set_t
 
typedef std::map< id_t, size_t > offset_map_t
 
typedef metric_comparison< T > metric_comparison_t
 
typedef metric_array_t::const_iterator const_iterator
 
typedef metric_array_t::iterator iterator
 

Public Member Functions

 metric_set (const ::int16_t version)
 
 metric_set (const header_type &header=header_type::default_header(), const ::int16_t version=0)
 
 metric_set (const metric_array_t &vec, const ::int16_t version, const header_type &header)
 
void copy_by_tile (const metric_set< T > &origin, const base_metric &tile_id)
 
void append_tiles (const metric_set< T > &origin, const base_metric &tile_id)
 
bool data_source_exists () const
 
void data_source_exists (const bool exists)
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
void sort ()
 
void rebuild_index (const bool update_ids=false)
 
void resize (const size_t n)
 
void reserve (const size_t n)
 
void trim (const size_t n)
 
void insert (const metric_type &metric)
 
void insert (const id_t id, const metric_type &metric)
 
void remove (iterator &it)
 
metric_typeoperator[] (const size_t n) INTEROP_THROW_SPEC((model
 
const metric_typeoperator[] (const size_t n) const INTEROP_THROW_SPEC((model
 
metric_typeat (const size_t n) INTEROP_THROW_SPEC((model
 
const metric_typeat (const size_t n) const INTEROP_THROW_SPEC((model
 
void set_version (const ::int16_t version)
 
key_vector keys () const
 
id_vector lanes () const
 
size_t lane_count () const
 
size_t max_lane () const
 
id_vector tile_numbers_for_lane (const uint_t lane) const
 
void populate_tile_numbers_for_lane (id_set_t &tile_number_set, const uint_t lane) const
 
void populate_tile_numbers_for_lane_surface (id_set_t &tile_number_set, const uint_t lane, const uint_t surface, const constants::tile_naming_method naming_convention) const
 
id_vector tile_numbers () const
 
metric_array_t metrics_for_lane (const uint_t lane) const
 
void metrics_for_lane (metric_array_t &lane_metrics, const uint_t lane) const
 
id_vector cycles () const
 
metric_array_t metrics_for_cycle (const uint_t cycle) const
 
size_t size () const
 
bool empty () const
 
::int16_t version () const
 
void clear ()
 
const metric_array_tmetrics () const
 
offset_map_toffset_map ()
 
metric_typeget_metric_ref (uint_t lane, uint_t tile, uint_t cycle=0) INTEROP_THROW_SPEC((model
 
metric_typeget_metric_ref (id_t key) INTEROP_THROW_SPEC((model
 
size_t find (const uint_t lane, const uint_t tile, const uint_t cycle=0) const
 
size_t find (const id_t id) const
 
const metric_typeget_metric (const uint_t lane, const uint_t tile, const uint_t cycle=0) const INTEROP_THROW_SPEC((model
 
bool has_metric (const uint_t lane, const uint_t tile, const uint_t cycle=0) const
 
const metric_typeget_metric (const id_t key) const INTEROP_THROW_SPEC((model
 
bool has_metric (const id_t id) const
 
void clear_lookup ()
 

Static Public Member Functions

static const char * prefix ()
 
static const char * suffix ()
 

Protected Attributes

metric_array_t m_data
 
::int16_t m_version
 
bool m_data_source_exists
 
offset_map_t m_id_map
 

Detailed Description

template<typename T>
class illumina::interop::model::metric_base::metric_set< T >

Metric set holds a collection metrics

This class holds a map that maps a unique id to the metric.

Member Typedef Documentation

typedef T::base_t base_t

Define the base type for the metric

typedef metric_array_t::const_iterator const_iterator

Const metric iterator

typedef T::header_type header_type

Define a write header

typedef std::set<uint_t> id_set_t

Define a set of ids

typedef T::id_t id_t

Define a ID type

typedef std::vector<uint_t> id_vector

Define an id vector

typedef metric_array_t::iterator iterator

Metric iterator

typedef std::vector<id_t> key_vector

Define an key vector

typedef std::vector<T> metric_array_t

Define a collection of metrics

Define a safe comparison for ids

Define a metric set type

typedef T metric_type

Define a metric type

typedef std::map<id_t, size_t> offset_map_t

Define offset map

typedef metric_array_t::size_type size_type

Define the size type

typedef T::uint_t uint_t

Define a lane/tile/cycle id type

Member Enumeration Documentation

anonymous enum
Enumerator
TYPE 

Group type enum

LATEST_VERSION 

Latest version of the format

Constructor & Destructor Documentation

metric_set ( const ::int16_t  version)
inline

Constructor

Parameters
versionversion of the file format
metric_set ( const header_type header = header_type::default_header(),
const ::int16_t  version = 0 
)
inline

Constructor

Parameters
headerheader information for the metric set
versionversion of the file format
metric_set ( const metric_array_t vec,
const ::int16_t  version,
const header_type header 
)
inline

Constructor

Parameters
vecarray of metrics
versionof the metric format
headerheader information for the metric set

Member Function Documentation

void append_tiles ( const metric_set< T > &  origin,
const base_metric tile_id 
)
inline

Adds records only for a specific tile

Parameters
originfull metric set
tile_idselected tile
metric_type& at ( const size_t  n)
inline

Get a metric at the given index

Deprecated:
Will be removed in next feature version (use operator[] instead for C++ Code)
Parameters
nindex
Returns
metric
const metric_type& at ( const size_t  n) const
inline

Get a metric at the given index

Deprecated:
Will be removed in next feature version (use operator[] instead for C++ Code)
Parameters
nindex
Returns
metric
const_iterator begin ( ) const
inline

Get start of metric collection

Returns
iterator to start of metric collection
iterator begin ( )
inline

Get start of metric collection

Returns
iterator to start of metric collection
void clear ( )
inline

Clear the metrics in the metric set

void clear_lookup ( )
inline

Clear the lookup table.

void copy_by_tile ( const metric_set< T > &  origin,
const base_metric tile_id 
)
inline

Copy records only for a specific tile

Parameters
originfull metric set
tile_idselected tile
id_vector cycles ( ) const
inline

Get a list of all cycles listed in the metric set

Note
Returns empty array for metrics that do not have a cycle identifier
Returns
vector of cycle numbers
bool data_source_exists ( ) const
inline

Flag that indicates whether the data source exists

Returns
true if the data source, e.g. file, exists
void data_source_exists ( const bool  exists)
inline

Set flag that indicates whether the data source exists

Parameters
existstrue if the data source, e.g. file, exists
bool empty ( ) const
inline

Test if metric set is empty

Returns
true if metric set is empty
const_iterator end ( ) const
inline

Get end of metric collection

Returns
iterator to end of metric collection
iterator end ( )
inline

Get end of metric collection

Returns
iterator to end of metric collection
size_t find ( const uint_t  lane,
const uint_t  tile,
const uint_t  cycle = 0 
) const
inline

Find index of metric given the id. If not found, return number of metrics

Parameters
lanelane
tiletile
cyclecycle
Returns
index of metric or number of metrics
size_t find ( const id_t  id) const
inline

Find index of metric given the id. If not found, return number of metrics

Parameters
idid
Returns
index of metric or number of metrics
const metric_type& get_metric ( const uint_t  lane,
const uint_t  tile,
const uint_t  cycle = 0 
) const
inline

Get metric for lane, tile and cycle

Parameters
lanelane
tiletile
cyclecycle
Returns
metric
const metric_type& get_metric ( const id_t  key) const
inline

Get metric for a unique identifier

Parameters
keyunique id built from lane, tile and cycle (if available)
Returns
metric
metric_type& get_metric_ref ( uint_t  lane,
uint_t  tile,
uint_t  cycle = 0 
)
inline

Get metric for lane, tile and cycle

Parameters
lanelane
tiletile
cyclecycle
Returns
metric
metric_type& get_metric_ref ( id_t  key)
inline

Get metric for a unique identifier

Parameters
keyunique id built from lane, tile and cycle (if available)
Returns
metric
bool has_metric ( const uint_t  lane,
const uint_t  tile,
const uint_t  cycle = 0 
) const
inline

Test if set has metric

Parameters
lanelane
tiletile
cyclecycle
bool has_metric ( const id_t  id) const
inline

Test if set has metric

Parameters
idid
void insert ( const metric_type metric)
inline

Add a metric to the metric set

Parameters
metricmetric to add to set
void insert ( const id_t  id,
const metric_type metric 
)
inline

Add a metric to the metric set

Parameters
idunique id for metric
metricmetric to add to set
key_vector keys ( ) const
inline

Get a list of all available lane numbers

Returns
vector of lane numbers
size_t lane_count ( ) const
inline

Get the number of lanes in the data

Returns
number of lanes
id_vector lanes ( ) const
inline

Get a list of all available lane numbers

Returns
vector of lane numbers
size_t max_lane ( ) const
inline

Get maximum lane number

Returns
maximum lane number
const metric_array_t& metrics ( ) const
inline

Get the metrics in a vector

Returns
vector of metrics
metric_array_t metrics_for_cycle ( const uint_t  cycle) const
inline

Get a list of all available metrics for the specified cycle

Note
Returns empty array for Tile Metrics, which does not contain a cycle identifier
Parameters
cyclecycle number
Returns
vector of metrics that map to the given cycle
metric_array_t metrics_for_lane ( const uint_t  lane) const
inline

Get a list of all available metrics for the specified lane

Parameters
lanelane number
Returns
vector of tile numbers
void metrics_for_lane ( metric_array_t lane_metrics,
const uint_t  lane 
) const
inline

Get a list of all available metrics for the specified lane

Parameters
lane_metricsdestination metric array
lanelane number
offset_map_t& offset_map ( )
inline

Get the current id offset map

Returns
id offset map
metric_type& operator[] ( const size_t  n)
inline

Get a metric at the given index

Parameters
nindex
Returns
metric
const metric_type& operator[] ( const size_t  n) const
inline

Get a metric at the given index

Parameters
nindex
Returns
metric
void populate_tile_numbers_for_lane ( id_set_t tile_number_set,
const uint_t  lane 
) const
inline

Get a list of all available tile numbers for the specified lane

Note
this does not clear the set!
Parameters
tile_number_setdestination set to ensure unique tile numbers
lanelane number
void populate_tile_numbers_for_lane_surface ( id_set_t tile_number_set,
const uint_t  lane,
const uint_t  surface,
const constants::tile_naming_method  naming_convention 
) const
inline

Get a list of all available tile numbers for the specified lane

Note
this does not clear the set!
Parameters
tile_number_setdestination set to ensure unique tile numbers
lanelane number
surfacesurface number
naming_conventiontile naming convetion enum
static const char* prefix ( )
inlinestatic

Get the prefix of the InterOp filename

Returns
prefix
void rebuild_index ( const bool  update_ids = false)
inline

Rebuild the index map and update the cycle state

Note
This function clears the lookup table for most metrics if update_ids is false (exceptions are Tile and DynamicPhasing
Parameters
update_idsrebuild the lookup table with new ids
void remove ( iterator it)
inline

Remove a metric from the metric set

Parameters
ititerator to metric to remove
void reserve ( const size_t  n)
inline

Reserve the number of places in the metric vector

Parameters
nmaximum number of elements
void resize ( const size_t  n)
inline

Resize the number of places in the metric vector

Parameters
nexpected number of elements
void set_version ( const ::int16_t  version)
inline

Set the version of the InterOp file

The InterOp file version determines which metric fields are populated. Each metric lists which version is supported.

Parameters
versionversion number
size_t size ( ) const
inline

Number of metrics in the metric set

Returns
number of metrics
void sort ( )
inline

Sort the metric collection

static const char* suffix ( )
inlinestatic

Get the suffix of the InterOp filename

Returns
suffix
id_vector tile_numbers ( ) const
inline

Get a list of all available tile numbers

Returns
vector of tile numbers
id_vector tile_numbers_for_lane ( const uint_t  lane) const
inline

Get a list of all available tile numbers for the specified lane

Parameters
lanelane number
Returns
vector of tile numbers
void trim ( const size_t  n)
inline

Trim the set to the proper number of metrics

Parameters
nactual size of the metric set
::int16_t version ( ) const
inline

Version of the InterOp file parsed

The InterOp file version determines which metric fields are populated. Each metric lists which version is supported.

Returns
interop file version

Member Data Documentation

metric_array_t m_data
protected

Array of metric data

bool m_data_source_exists
protected

Does the file or other source exist

offset_map_t m_id_map
protected

Map unique identifiers to the index of the metric

::int16_t m_version
protected

Version of the metric read


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