constant_mapping< Key, Value > Class Template Reference

#include <constant_mapping.h>

Public Member Functions

const Value & get (const Key &key, const Value &default_value) const
 

Static Public Member Functions

static const constant_mapping< Key, Value > & fmapping (const std::pair< Key, Value > *pairs, size_t pair_count)
 
static const constant_mapping< Key, Value > & rmapping (const std::pair< Value, Key > *pairs, size_t pair_count)
 

Detailed Description

template<class Key, class Value>
class illumina::interop::util::constant_mapping< Key, Value >

A singleton that maps a key to a value

Member Function Documentation

static const constant_mapping<Key, Value>& fmapping ( const std::pair< Key, Value > *  pairs,
size_t  pair_count 
)
inlinestatic

Get instance of singleton

Parameters
pairsarray of values mapping Key to Value
pair_countnumber of pairs in array
Returns
instance of singleton
const Value& get ( const Key &  key,
const Value &  default_value 
) const
inline

Get the value corresponding to the key or default_value if none exists

Parameters
keykey to search for in mapping
default_valuevalue to return if the key is not found
Returns
value found (or default_value)
static const constant_mapping<Key, Value>& rmapping ( const std::pair< Value, Key > *  pairs,
size_t  pair_count 
)
inlinestatic

Get instance of singleton

Note
This reverse the input pair to setup a reverse mapping
Parameters
pairsarray of values mapping Key to Value
pair_countnumber of pairs in array
Returns
instance of singleton

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