text_format_factory< Metric > Struct Template Reference

#include <text_format_factory.h>

Public Types

typedef Metric metric_type
 
typedef abstract_text_format< metric_typeabstract_text_format_t
 
typedef Metric::header_type header_type
 
typedef stdbp::unique_ptr< abstract_text_format_tmetric_format_pointer
 

Public Member Functions

typedef INTEROP_UNORDERED_MAP (int, metric_format_pointer) text_format_map
 
abstract_text_format_tfind (int version)
 
void add (abstract_text_format_t *pformat)
 
size_t size () const
 

Static Public Member Functions

static text_format_factory< Metric > & instance ()
 

Detailed Description

template<class Metric>
struct illumina::interop::io::text_format_factory< Metric >

Factory for generating text formats

This class defines static methods to register a metric format. The registered metric formats can be accessed through the instance() static function.

Note
this is not thread safe

Member Typedef Documentation

Define the abstract format type

typedef Metric::header_type header_type

Define the header type

Define a unique pointer to a metric format

typedef Metric metric_type

Define the metric type

Member Function Documentation

void add ( abstract_text_format_t pformat)
inline

Add a text format to the factory

Parameters
pformatformat to add
abstract_text_format_t* find ( int  version)
inline

Find a format for a given version

If the format is not found, return null

Parameters
versionversion to search for
Returns
pointer to format or null
static text_format_factory<Metric>& instance ( )
inlinestatic

Instance of the factory singleton

Note
this is not thread safe
Returns
instance to singleton
typedef INTEROP_UNORDERED_MAP ( int  ,
metric_format_pointer   
)

Define a map between format version and the format

size_t size ( ) const
inline

Get number of text formats

Returns
number of text formats

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